On Tue, 10 Feb 2004 12:40:45 -0500, John Liang wrote: > >Hello, > >And that's after the patch. In fact, the patch is a little different than >what is specified. > >Step 1: You need to find the Jar file: it is located in WebSphere >Studio/Application Developer/v5.1/runtimes/base_v5/lib/txPrivate.jar, make >sure you have put it into your classpath or in Ant script >Step 2: Modify castor-<version >number>/src/main/org/exolab/castor/jdo/JDO.java as follows: > >a) Comment out the JNDI InitialContext and lookup >b) Replace with tm = com.ibm.ejs.jts.jta.JTSXA.instance (); >c) Since we are no longer using JNDI, thus we don't need to provide catch >for "NoInitialContextException" and "NameNotFoundException", so I comment >them out. >d) go back up to src directory and issue ant build command: >% ant > >It should build fine. > >However, I still got "SQLException: Operation Connection.commit () is not >allowed during a global transaction" inside TransactionAbortedException. >Any suggestions?
Yes. When using global transactions (as coordinated by Websphere), you must not use calls to Database.begin() and Database.commit() in your code. By setting the <trans-attribute> to 'required', you have specified that the container does transaction demarcation for you ... and above exception indicates that a global transaction is already active, and hence a call to Database.commit() is illegal. I hope this clarifies things ... Werner > >In the DD (ejb-jar.xml), I have setup ><trans-attribute>Required</trans-attribute> for <container-transaction> of >the bean using JDO. > >Thanks in advance, >John > >-----Original Message----- >From: John Liang [mailto:[EMAIL PROTECTED] >Sent: Tuesday, February 10, 2004 12:08 PM >To: [EMAIL PROTECTED] >Subject: Re: [castor-dev] Question about how to patch Castor JDO with >WebSphere 5.0 > > > >Hello, > >I still got the problem of "SQLException: Operation Connection.commit () is >not allowed during a global transaction." It is embedded inside >"TransactionAbortedException". Any suggestions? > >Thanks, >John > >-----Original Message----- >From: Werner Guttmann [mailto:[EMAIL PROTECTED] >Sent: Tuesday, February 10, 2004 3:58 AM >To: [EMAIL PROTECTED] >Subject: Re: [castor-dev] Question about how to patch Castor JDO with >WebSphere 5.0 > > > >John, > >you might want to have a look at the following email in the archives: > >http://marc.theaimsgroup.com/?l=castor-dev&m=106363183315700&w=2 > >This explains what needs to be done to make Castor work with Websphere. > >Regards >Werner > >On Tue, 10 Feb 2004 09:39:40 +0100, Werner Guttmann wrote: > >> >>Bruce, >> >>somebody kindly posted a patch a couple of months ago so that Castor can be >used in J2EE mode with WebSphere (which by default is not an option >>with the current code base). Top of my head, I think that one needs to >patch JDO.getDatabase() to use a Websphere-specific class to obtain a valid >>javax.jta.Transaction object rather than going through a JNDI lookup (hich >WebSphere does not support). >> >>Now if only I could find this patch myself .... >> >>Regards >>Werner >> >>On Tue, 10 Feb 2004 01:46:14 +0000 (GMT), Bruce Snyder wrote: >> >>> >>>This one time, at band camp, John Liang said: >>> >>>JL>I have seen code to patch WebSphere 5.0, however, I could not find the >jar >>>JL>for JTSXA. Please let me know where is that such that I can patch it >up. >>> >>>John, >>> >>>What code are you referring to that patches Websphere? I am not aware >>>of such a thing. >>> >>>Also, I'm not sure why you're interested in the JTS API jar. The JTS >>>is for Transaction Manager implementors. If you're referring to the JTA >>>API jar, that is inclued in the Castor lib directory. >>> >>>Bruce >>>-- >>>perl -e 'print >unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");' >>> >>>The Castor Project >>>http://www.castor.org/ >>> >>>Apache Geronimo >>>http://incubator.apache.org/projects/geronimo.html >>> >>>----------------------------------------------------------- >>>If you wish to unsubscribe from this mailing, send mail to >>>[EMAIL PROTECTED] with a subject of: >>> unsubscribe castor-dev >>> >> >>----------------------------------------------------------- >>If you wish to unsubscribe from this mailing, send mail to >>[EMAIL PROTECTED] with a subject of: >> unsubscribe castor-dev >> > >----------------------------------------------------------- >If you wish to unsubscribe from this mailing, send mail to >[EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > >----------------------------------------------------------- >If you wish to unsubscribe from this mailing, send mail to >[EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > >----------------------------------------------------------- >If you wish to unsubscribe from this mailing, send mail to >[EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
