[JBoss JIRA] (JBTM-971) Allow a ServiceRequst method to programaticaly state that it is ReadOnly
by Paul Robinson (Created) (JIRA)
Allow a ServiceRequst method to programaticaly state that it is ReadOnly
------------------------------------------------------------------------
Key: JBTM-971
URL: https://issues.jboss.org/browse/JBTM-971
Project: JBoss Transaction Manager
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: TxBridge
Reporter: Paul Robinson
Assignee: Paul Robinson
Fix For: 5.0.0.M2
The RequestType attribute on the ServiceRequest annotation identifies whether the service request is always read only as far as transactional modifications are concerned or, alternatively, that it may make changes to transactional data. in the latter case the service request method can indicate a read-only outcome by invoking the readOnly method of an injected control.
{code}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ServiceRequest
{
public RequestType requestType() default RequestType.MODIFY;
}
{code}
The framework does not normally register lifecycle callbacks for ServiceRequest methods whose request type is READ_ONLY (see the next paragraph for the rider which qualifies this statement). The framework does normally register callbacks for ServiceRequest methods whose request type is MODIFY, on the assumption that the method has performed transactional changes. The latter methods may inhibit registration of lifecycle methods by calling the readOnly() method of an injected transaction control.
The reason why it is important to identify READ_ONLY methods is that they affect the way the framework performs PREPARE or COMPLETE processing (as appropriate to the protocol in question). If all ServiceRequest methods in the transaction are READ_ONLY the participant will trigger READ_ONLY or EXIT callbacks, respectively, for these lifecycle events, precluding further involvement in the transaction. If any of the ServiceRequest methods is not READ_ONLY then the framework will trigger PREPARE or COMPLETE callbacks, respectively. Clearly, it would be futile for a READ_ONLY declaration or notification to inhibit registration of callbacks which are triggered by READ_ONLY or EXIT events. So, the framework only registers READ_ONLY or EXIT lifecycle callbacks when they are triggered by READ_ONLY methods or by MODIFY methods which notify their READ_ONLY status using an injected control.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 7 months
[JBoss JIRA] (JBTM-969) Specify external participant lifecycle class on a per ServiceRequest method basis
by Paul Robinson (Created) (JIRA)
Specify external participant lifecycle class on a per ServiceRequest method basis
---------------------------------------------------------------------------------
Key: JBTM-969
URL: https://issues.jboss.org/browse/JBTM-969
Project: JBoss Transaction Manager
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: TxBridge
Reporter: Paul Robinson
Assignee: Paul Robinson
Fix For: 5.0.0.M2
This class level annotation allows the class which is the target of lifecycle handler callbacks to be specified. If this annotation is not specified, the clas contining the @ServiceInvocation is assumed to also contain the associated Lifecycle Handler methods.
{code}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ParticipantService
{
public Class lifecycleClass() default Default.class;
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 7 months
[JBoss JIRA] Created: (JBTM-881) Transaction is not active in JBOSSTS_4_6_1_GA
by e t (JIRA)
Transaction is not active in JBOSSTS_4_6_1_GA
---------------------------------------------
Key: JBTM-881
URL: https://issues.jboss.org/browse/JBTM-881
Project: JBoss Transaction Manager
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: JTS
Affects Versions: 4.6.1
Environment: JBOSS 5.1.0.GA
Reporter: e t
I found the following error log in the server log file when my application work not properly.
===============================================================================================================
12:45:00,300 SEVERE [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >)
12:45:00,302 ERROR [OrganizationBean] Get user menu error:userId=sales_huangchi;permissionUrl=sales
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
at com.tcl.drp.ejb.right.FunctionPermissionBean.getPermissionMenuLevelItemById(FunctionPermissionBean.java:201)
at sun.reflect.GeneratedMethodAccessor956.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
at sun.reflect.GeneratedMethodAccessor282.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_2094028558.invoke(InvocationContextInterceptor_z_fillMethod_2094028558.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_2094028558.invoke(InvocationContextInterceptor_z_setup_2094028558.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)
at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
at org.hibernate.loader.Loader.doQuery(Loader.java:696)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2228)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
at org.hibernate.loader.Loader.list(Loader.java:2120)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1722)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
... 56 more
Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:46)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
... 69 more
Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:370)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
... 71 more
==============================================================================================================================
I am sure that the application code "com.tcl.drp.ejb.right.FunctionPermissionBean.getPermissionMenuLevelItemById" which lead to interact with Oracle Database response time is very short.
And I am sure that the application code "com.tcl.drp.ejb.right.FunctionPermissionBean.getPermissionMenuLevelItemById" is direct called by client code which is not associated with transaction(that is the transaction is managed(begin/commit/rollback) by the EJB Container).
I found something intresting is the the EJB's call is in the CallerTx:
===================================================================================
......
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
......
===================================================================================
In other word is that the EJB Container found a transaction is associated with current thread!
I search the key:"a030353:da53:4e5ebfb4:116904" in the server log file,some relate exception is found with that transaction(a030353:da53:4e5ebfb4:116904):
====================================================================================
11:54:54,929 WARN [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e786a41[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@91dfb7a handles=0 lastUse=1314849250816 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@27884b14 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@64f92252 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@387d8d3 txSync=null]
java.sql.SQLException: Io Exception:Broken pipe (errno:32)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.rollback(OracleConnection.java:1380)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.rollback(LocalManagedConnection.java:97)
at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.rollback(TxConnectionManager.java:1105)
at com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource.rollback(XAOnePhaseResource.java:138)
at com.arjuna.ats.arjuna.LastResourceRecord.topLevelAbort(LastResourceRecord.java:143)
at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3270)
at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3248)
at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1933)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:114)
at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:201)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1497)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:165)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:114)
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:162)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)
at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
11:54:55,654 SEVERE [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >)
11:54:55,668 ERROR [TxPolicy] javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
11:54:55,878 SEVERE [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a030353:da53:4e5ebfb4:116904 status: ActionStatus.ABORTING >)
====================================================================================
My question is :Is that a bug of JBOSS JTS_4_6_1?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 7 months
[JBoss JIRA] Created: (JBTM-851) Transaction timeout in JBoss caused deadlock with spring transaction manager
by Sergey Astakhov (JIRA)
Transaction timeout in JBoss caused deadlock with spring transaction manager
----------------------------------------------------------------------------
Key: JBTM-851
URL: https://issues.jboss.org/browse/JBTM-851
Project: JBoss Transaction Manager
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: JTA
Affects Versions: 4.14.0
Environment: JBoss 6, JBoss TS 4.14.0.Final, Hibernate 3.6.4.Final, Spring 3.0.5
Reporter: Sergey Astakhov
Priority: Critical
Deadlock scenario:
1. Transaction started. At some point, jdbc connection allocated from poll and registered as transaction resource.
2. After timeout event occured, JBoss try to rollback this transaction.
3. In process of rolling back transaction, reaper process try to get lock on connection to do rollback and stopped at this point in waiting.
4. Due to cancelling state of the transaction, exception is rised in main process of transaction.
5. Spring catched this exception and invokes rollback to transaction.
6. Inside jboss transaction manager there is synchronized method for making transaction abort, so this rollback invocation is waiting another thread to complete.
7. At final: JBoss hold synchronized lock on abort method, but wait for releasing lock on connection. Main process hold lock on connection, but wait for releasing lock on abort method. Deadlock state.
How this can be fixed:
Before trying to invoke abort method, check transaction state. If it is already in state of aborting - just rise IllegalStateException.
I'm also suggest to add similar check in spring code (https://jira.springsource.org/browse/SPR-8421), but such check should be in jboss code too, because any client code can suddenly get into this deadlock state.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months