One way might be to off-load the non-XA work to a separate bean which has its transaction attribute set to Not Supported.
-- Danny Yates -----Original Message----- From: Sasidharan, Manoj [mailto:[EMAIL PROTECTED] Sent: 18 November 2003 19:41 To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] Weblogic to JBoss Migration - Differences in XA and Non-XA DataS ource handling (Stack Trace) Hello Alex, Really not sure if this comes under J2EE specs. But I guess it should. If not, there is no way other way to achieve the real goal of using XA and Non-XA datasources. This holds good in BEA Tuxedo (C/C++ Transactional Middleware) and Weblogic worlds. BTW, is there any other way of achieving this? I mean if the application wants to have two datasources - XA and Non-XA and does not want the operations in Non-XA to any way impact the user transaction. Thanks a lot for taking some time for helping me out. We need a JBoss port of our application urgently for our customer. The initial development/testing was done on Weblogic. Hence the confusion. rgds MS -----Original Message----- From: Alexey Loubyansky [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 11:04 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Weblogic to JBoss Migration - Differences in XA and Non-XA DataS ource handling (Stack Trace) Sasidharan, Manoj wrote: > Yes. But I am trying to do this on a Non-XA datasource connection. This > should in no way impact the on-going user transaction. Is this behaviour defined in the spec? I guess, the philosophy is you are in a managed environment and should not set auto-commit yourself. > > I have two datasources - XA and Non-XA and Session bean uses both to > complete its operation. Only the XA needs to be rolled-back. > > rgds > MS > > -----Original Message----- > From: Alexey Loubyansky [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 18, 2003 4:50 AM > To: [EMAIL PROTECTED] > Subject: Re: [JBoss-user] Weblogic to JBoss Migration - Differences in > XA and Non-XA DataS ource handling (Stack Trace) > > > Are you trying to set autocommit? You can not do it in a managed tx. > > Sasidharan, Manoj wrote: > > >>Hello Adrian, >> >>Thanks for taking some time for helping me on this issue. Here is the > > stack > >>trace at the server when the problem occurs. >> >>20:26:31,122 WARN [TxConnectionManager$LocalXAResource] Prepare called on > > a > >>loc >>al tx. Use of local transactions on a jta transaction with more than one >>branch >>may result in inconsistent data in some cases of failure. >>20:26:31,137 ERROR [STDERR] [ERROR]You cannot set autocommit during a >>managed tr >>ansaction! >>20:26:31,215 ERROR [STDERR] [Thu Nov 13 20:26:31 PST 2003][CALL >>STACK][76b9eaa7d >>d7b7d6f4ea15cb77bdea60667df0][java.sql.SQLException: You cannot set >>autocommit d >>uring a managed transaction! >> at >>org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcA >>utoCommit(BaseWrapperManagedConnection.java:395) >> at >>org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(Wrapp >>edConnection.java:426) >> at com.plx.framework.sql.Serial.beginTrans(Serial.java:226) >> at > > com.plx.framework.sql.Serial.getNextNumberBlock(Serial.java:157) > >> at com.plx.framework.sql.Serial.getNextSerial(Serial.java:301) >> at com.plx.efw.server.system.Login.insertLogin(Login.java:197) >> at com.plx.efw.server.system.Login.login(Login.java:105) >> at >>com.plx.efw.server.system.SystemSessionBean.login(SystemSessionBean.j >>ava:275) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> >>Please let me know if you need some more information to analyze the > > problem. > >>rgds >>MS >> >>-----Original Message----- >>From: Adrian Brock [mailto:[EMAIL PROTECTED] >>Sent: Friday, November 14, 2003 12:38 AM >>To: [EMAIL PROTECTED] >>Subject: Re: [JBoss-user] Weblogic to JBoss Migration - Differences in >>XA and Non-XA DataSo urce handling >> >> >>On Fri, 2003-11-14 at 03:21, Sasidharan, Manoj wrote: >> >> >>>Hello All, >>> >>>JBoss 3.2.2 >>>Oracle 9.2.0.4 >>>Datasources are created using oracle-ds.xml (Non-XA) and oracle-xa-ds.xml >>>(XA) >>> >>>I have a Stateless session bean that gets an XA connection and does some >>>database updates. It also tries to get a Non-XA connection and perform >> >>some >> >> >>>database updates and for that tries to set AutoCommit ON. Our logic does >> >>not >> >> >>>expect the second updates to be any way affect the on-going user >>>transaction. Some how, the code does not work. The exception says that >>>auto-commit can be used inside Bean Managed Transactions. >>> >> >> >>Is the exception secret or do we have to guess? >> >>Regards, >>Adrian >> >> >> >>>The code just works fine in Weblogic. >>> >>>Any suggestions on what would be the problem or how to avoid it would be >>>highly appreciated. >>> >>>Thanks in advance. >>> >>>rgds >>>MS >>> >>> >>>------------------------------------------------------- >>>This SF.Net email sponsored by: ApacheCon 2003, >>>16-19 November in Las Vegas. Learn firsthand the latest >>>developments in Apache, PHP, Perl, XML, Java, MySQL, >>>WebDAV, and more! http://www.apachecon.com/ >>>_______________________________________________ >>>JBoss-user mailing list >>>[EMAIL PROTECTED] >>>https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > ------------------------------------------------------- > This SF. Net email is sponsored by: GoToMyPC > GoToMyPC is the fast, easy and secure way to access your computer from > any Web browser or wireless device. Click here to Try it Free! > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > > ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user