|
All, In a servlet that does the following: HttpServlet.doGet() Connection conn = dataSource.getConnection(); conn.setAutoCommit(false); // perform some work - only reading data conn.close(); We get the following exception: [8/3/04 14:08:18:756 EDT] 42ae42ae LocalTranCoor E WLTC0033E: Resource jdbc/ds_fax_tracking rolled back in cleanup of unresolved LocalTransactionContainment. [8/3/04 14:08:18:786 EDT] 42ae42ae LocalTranCoor E WLTC0032E: One or more resources rolled back. An unresolved LocalTransactionContainment had an unresolved action of rollback. [8/3/04 14:08:18:796 EDT] 42ae42ae WebAppTransac E WTRN0043I: LocalTransaction rolled-back due to setRollbackOnly. [8/3/04 14:08:18:836 EDT] 42ae42ae WebGroup E SRVE0026E: [Servlet Error]-[LocalTransaction rolled-back due to setRollbackOnly]: com.ibm.ws.LocalTransaction.RolledbackException at java.lang.Throwable.<init>(Throwable.java) In this case we do set auto commit to false but we actually did not do an updates / inserts / deletes. If we change this to: HttpServlet.doGet() Connection conn = dataSource.getConnection(); conn.setAutoCommit(false); // perform some work - only reading data conn.commit(); conn.close(); In this case we do not get this exception. The drawback is that we do a commit but we did not even modify any data. What is the correct way to handle this situation? How should we handle this (if we were not able to remove the auto commit false setting)? Etienne
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.