|Oracle8i Enterprise JavaBeans Developer's Guide and Reference
Release 3 (8.1.7)
Part Number A83725-01
If you are using JDBC calls in your bean to update a database, and you have an active transaction context, you should not also use JDBC to perform transaction services, by calling methods on the JDBC connection. Do not code JDBC transaction management methods. For example:
Doing so will cause a
SQLException to be thrown. Instead, you must commit using the
UserTransaction object retrieved to handle the global transaction. When you commit using the JDBC connection, you are instructing a local transaction to commit, not the global transaction. When the connection is involved in a global transaction, trying to commit a local transaction within the global transaction causes an error to occur.
In the same manner, you must also avoid doing direct SQL commits or rollbacks through JDBC. Code the bean to either handle transactions directly using the
UserTransaction interface or let the bean container manage the bean transactions.