This is a discussion on No global transaction exception on read-only CMP operation? - Weblogic ; Sorry for the cross post, but I thought maybe I'd get a better response here. I've got a stateless session bean which is attempting to get an entity bean via some finder method. If the bean is found, I invoke ...
Sorry for the cross post, but I thought maybe I'd get a better response
I've got a stateless session bean which is attempting to get an entity
bean via some finder method. If the bean is found, I invoke
sessionContext.setRollbackOnly() to rollback the transaction, even
though no updates have been performed.
A completely different method then gets invoked on the session bean,
which invokes a series of finder methods, and more often than not
about half-way through I end up with
java.sql.SQLException: SQL operations are not allowed with
no global transaction by default for XA drivers. etc
On the other hand, if the initial find by fails, I go on to create an
entity bean and the same method gets invoked on the session bean and
everything works just fine.
While this is dealing with WLS7SP2, I see there is a known issue with
By default, database connections that use an XA driver have autoCommit
set to false. If you use a database connection that is based on an XA
driver for a read-only operation, the connection implicitly creates a
local transaction. When the connection is returned to the connection
pool, the local transaction still exists on the connection. The next
time the connection is used, WebLogic Server internally calls
XAResource.start(), which fails because there is already a transaction
on the connection.
Workaround: Set autoCommit to true or call connection.commit() before
returning the connection to the connection pool.
Since in the first (error) case, I am indeed doing a read only
operation, I am wondering if I might be running into the same problem,
and perhaps WebLogic's CMP does not return the connection back to the
Please let me know any additional info needed to help shed light on