atomikos 创建数据源,报Max number of active transactions

简介:
在使用atomikos 事务管理中,当并发数超过50的时候会产生异常如下:
java.lang.IllegalStateException:Max number of active transactions reched:50

原因:

atomikos的默认配置中 transactions.properties中:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# SAMPLE PROPERTIES FILE FOR THE TRANSACTION SERVICE
# THIS FILE ILLUSTRATES THE DIFFERENT SETTINGS FOR THE TRANSACTION MANAGER
# UNCOMMENT THE ASSIGNMENTS TO OVERRIDE DEFAULT VALUES;
 
# Required: factory implementation  class  of the transaction core.
# NOTE: there is no  default  for  this , so it MUST be specified! 
com.atomikos.icatch.service=com.atomikos.icatch.standalone.UserTransactionServiceFactory
 
         
# Set base name of file where messages are output 
# (also known as the  'console file' ).
#
# com.atomikos.icatch.console_file_name = tm.out
 
# Size limit (in bytes)  for  the console file;
# negative means unlimited.
#
# com.atomikos.icatch.console_file_limit=- 1
 
# For size-limited console files,  this  option
# specifies a number of rotating files to 
# maintain.
#
# com.atomikos.icatch.console_file_count= 1
 
# Set the number of log writes between checkpoints
#
# com.atomikos.icatch.checkpoint_interval= 500
 
# Set output directory where console file and other files are to be put
# make sure  this  directory exists!
#
# com.atomikos.icatch.output_dir = ./
 
# Set directory of log files; make sure  this  directory exists!
#
# com.atomikos.icatch.log_base_dir = ./
 
# Set base name of log file
this  name will be  used as the first part of 
# the system-generated log file name
#
# com.atomikos.icatch.log_base_name = tmlog
 
# Set the max number of active local transactions 
# or - 1  for  unlimited.
#
# com.atomikos.icatch.max_actives =  50  (原因)
 
# Set the  default  timeout (in milliseconds)  for  local transactions
#
# com.atomikos.icatch.default_jta_timeout =  10000
 
# Set the max timeout (in milliseconds)  for  local transactions
#
# com.atomikos.icatch.max_timeout =  300000
 
# The globally unique name of  this  transaction manager process
# override  this  value with a globally unique name
#
# com.atomikos.icatch.tm_unique_name = tm
     
# Do we want to use parallel subtransactions? JTA's  default
# is NO  for  J2EE compatibility
#
# com.atomikos.icatch.serial_jta_transactions= true
                     
# If you want to  do  explicit resource registration then
# you need to set  this  value to  false .
#
# com.atomikos.icatch.automatic_resource_registration= true  
     
# Set  this  to WARN, INFO or DEBUG to control the granularity
# of output to the console file.
#
# com.atomikos.icatch.console_log_level=WARN
     
# Do you want transaction logging to be enabled or not?
# If set to  false , then no logging overhead will be done
# at the risk of losing data after restart or crash.
#
# com.atomikos.icatch.enable_logging= true
 
# Should two-phase commit be done in (multi-)threaded mode or not?
# Set  this  to  false  if  you want commits to be ordered according
# to the order in which resources are added to the transaction.
#
# NOTE: threads are reused on JDK  1.5  or higher. 
# For JDK  1.4 , thread reuse is enabled as soon as the 
# concurrent backport is in the classpath - see 
# http: //mirrors.ibiblio.org/pub/mirrors/maven2/backport-util-concurrent/backport-util-concurrent/
#
# com.atomikos.icatch.threaded_2pc= false
 
# Should shutdown of the VM trigger shutdown of the transaction core too?
#
# com.atomikos.icatch.force_shutdown_on_vm_exit= false

修改默认配置中的:

1
com.atomikos.icatch.max_actives =  50 ------改为更大就可以解决












本文转自yunlielai51CTO博客,原文链接:http://blog.51cto.com/4925054/2067855 ,如需转载请自行联系原作者

相关文章
错误: 实例 "ahwater-linux-core" 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7c1609
错误: 实例 "ahwater-linux-core" 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7c1609c9-9d0f-4836-85b3-cefd45f942a7.
5459 0
Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7d90eb80-29e2-4238-b658-ade407ff9456. Last exception: [u'Trace
Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7d90eb80-29e2-4238-b658-ade407ff9456.
1637 0
错误: 实例 "ahwater-linux-core" 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7c1609
错误: 实例 "ahwater-linux-core" 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7c1609c9-9d0f-4836-85b3-cefd45f942a7.
1670 0
Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance
Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance
1747 0
Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7d90eb80-29e2-4238-b658-ade407ff9456. Last exception: [u'Trace
Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7d90eb80-29e2-4238-b658-ade407ff9456.
1233 0
|
11月前
|
算法
Leetcode 313. Super Ugly Number
题目翻译成中文是『超级丑数』,啥叫丑数?丑数就是素因子只有2,3,5的数,7 14 21不是丑数,因为他们都有7这个素数。 这里的超级丑数只是对丑数的一个扩展,超级丑数的素因子不再仅限于2 3 5,而是由题目给定一个素数数组。与朴素丑数算法相比,只是将素因子变了而已,解法还是和朴素丑数一致的。
93 1
|
4月前
|
存储 SQL 算法
LeetCode 题目 65:有效数字(Valid Number)【python】
LeetCode 题目 65:有效数字(Valid Number)【python】
|
5月前
|
存储 算法
【LeetCode力扣】单调栈解决Next Greater Number(下一个更大值)问题
【LeetCode力扣】单调栈解决Next Greater Number(下一个更大值)问题
40 0
|
11月前
|
存储
Leetcode Single Number II (面试题推荐)
给你一个整数数组,每个元素出现了三次,但只有一个元素出现了一次,让你找出这个数,要求线性的时间复杂度,不使用额外空间。
37 0
|
算法
LeetCode 414. Third Maximum Number
给定一个非空数组,返回此数组中第三大的数。如果不存在,则返回数组中最大的数。要求算法时间复杂度必须是O(n)。
89 0
LeetCode 414. Third Maximum Number