[Persistence, JBoss/CMP, Hibernate, Database] - reuse same transaction hit error in JBoss
by gan.gary
I have Java/HIbernate apps. When run in Eclipse/JAR file with this, it works fine.
public void saveToDatabase() throws Exception
| {
| Transaction txReporting = null;
| try{
| txReporting = sesReporting.beginTransaction();
| ...
| txReporting.commit();
| } catch (Exception e) {
| if (txReporting != null) {
| // Something went wrong; discard all partial changes
| txReporting.rollback();
| // nested try-catch loop to catch all errors
| try{
| // for logging purpose
| txReporting = sesReporting.beginTransaction();
| ...
| txReporting.commit();
| } catch (Exception ex) {
| throw ex;
| }
| }
| throw e;
| }
| }
But when I throw this into JBoss, I hit:
anonymous wrote : 2008-07-23 17:46:04,291 DEBUG [org.hibernate.util.JDBCExceptionReporter] Cannot open connection [???]
| org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: acc550a:c94:4886fda0:41 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: acc550a:c94:4886fda0:41 status: ActionStatus.ABORT_ONLY >)
| ...
| Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: acc550a:c94:4886fda0:41 status: ActionStatus.ABORT_ONLY >
| at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
| ... 53 more
| 2008-07-23 17:46:04,307 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null
| 2008-07-23 17:46:04,307 ERROR [org.hibernate.util.JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: acc550a:c94:4886fda0:41 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: acc550a:c94:4886fda0:41 status: ActionStatus.ABORT_ONLY >)
| 2008-07-23 17:46:04,307 ERROR [STDERR] org.hibernate.exception.GenericJDBCException: Cannot open connection
anyone?
is this called "multiple one-phase" : http://wiki.jboss.org/wiki/Multiple1PC ?
I thought using 2 separate transactions is required MSDTC (change <local-tx-datasource> to <xa-datasource>. )?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166113#4166113
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166113
17 years, 9 months
[Clustering/JBoss] - Dirty Metadata - stucked
by spezam
Hello,
I'm configuring a Jboss (4.2.3.GA - jdk 6.0_04) cluster on Centos Linux 5.2 following this document
http://docs.jboss.org/jbossas/jboss4guide/r4/html/cluster.chapt.html
section:
16.5. HTTP Services
Everything is working fine, the two Jboss instances see each other and according to jboss.cache:service=TomcatClusteringCache MBean/printDetails you can see the same web session details on the two nodes.
The application sets an Anonymous session as soon as the user hits the first page. The same session is updated with more attributes when the user login.
When I test the session replication with the application I do the following:
- access the application on one node (depends on where the loadbalancer is sending me)
- login
- move around the application
- take down the node where I'm logged in and refresh the page so the request is directed on the second node.
As soon as I refresh I got the following exception:
08:53:39,633 ERROR [JBossCacheService] loadSession(): id: rBj5KyYzuQuqHC0lK4BSWA** exception occurred during deserialization
java.lang.ArrayStoreException: org.springframework.security.GrantedAuthorityImpl
Debugging the application on both the nodes I can notice differences between the session attributes on the replicated node.
ex.
sessionMetadataDirty = true
version = 0
...
Anyone has an idea why this is happening?
Is there a way to check the reason why the session attributes aren't replicated correctly? Any debugging option?
Thanks in advance for your answer.
Matteo
Linux System Manager - Fi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166112#4166112
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166112
17 years, 9 months