I had reported this error some time back but forgot to pursue it, since I
did a local fix and moved ahead. This problem surfaced again today when I
tried to deploy the jakarta_slide code from CVS Head.
Bug description:
When Slide is deployed in JBoss App Server, the connections returned by the
J2EEStore have autocommit set to true. As a result the tx commits and
rollbacks fail and further call for a new transaction fails with the
following error:
17:39:26,796 INFO [STDOUT] 22 Jun 2004 17:39:26 -
org.apache.slide.common.Namespace - INFO - Loading namespace slide base data
17:39:26,843 INFO [STDOUT] 22 Jun 2004 17:39:26 -
org.apache.slide.transaction.SlideTransaction - WARNING - Rollback failure:
Resource manager org.apache.slide
[EMAIL PROTECTED] Error code XA_HEURCOM in Transaction 1
xid main-1087906166828-1- in thread main
17:39:26,843 INFO [STDOUT] 22 Jun 2004 17:39:26 -
org.apache.slide.common.Namespace - INFO - Init namespace slide
configuration
17:39:26,906 INFO [STDOUT] 22 Jun 2004 17:39:26 -
org.apache.slide.common.Namespace - INFO - Import data into namespace slide
17:39:26,937 INFO [STDOUT] 22 Jun 2004 17:39:26 -
org.apache.slide.common.XMLUnmarshaller - INFO - Loading object /
17:39:26,953 INFO [STDOUT] 22 Jun 2004 17:39:26 -
org.apache.slide.transaction.SlideTransaction - WARNING - Enlist failure:
Resource manager org.apache.slide.s
[EMAIL PROTECTED] Error code XAER_INVAL in Transaction 3 xid
main-1087906166906-3- in thread main
17:39:27,156 INFO [STDOUT] 22 Jun 2004 17:39:27 -
org.apache.slide.transaction.SlideTransaction - WARNING - Enlist failure:
Resource manager org.apache.slide.s
[EMAIL PROTECTED] Error code XAER_INVAL in Transaction 3 xid
main-1087906166906-3- in thread main
...... same error repeats several times
Atleast with JBoss it is not possible to declaratively set autocommit to
false on DB Connections. I had confirmed this with JBoss support(ref:
http://jboss.org/index.html?module=bb&op=viewtopic&t=48838). I have not
tested with Weblogic and Websphere.
Bug fix: Setting autocommit to false when returning the connection from
J2EEStore. This fix should not cause any problems on other app servers
either.
Patch: Please find attached the patch for J2EEStore. I hope someone could
look at this.
Regards,
Ritu
<<autocmmit_patch.txt>>
Index: J2EEStore.java
===================================================================
RCS file:
/home/cvspublic/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/J2EEStore.java,v
retrieving revision 1.11
diff -u -r1.11 J2EEStore.java
--- J2EEStore.java 11 Feb 2004 11:30:21 -0000 1.11
+++ J2EEStore.java 22 Jun 2004 12:49:35 -0000
@@ -155,6 +155,10 @@
}
protected Connection getNewConnection() throws SQLException {
- return ds.getConnection();
+ Connection con = ds.getConnection();
+ boolean autoCommit = con.getAutoCommit();
+ if(autoCommit)
+ con.setAutoCommit(false);
+ return con;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]