You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ma...@apache.org on 2003/08/28 23:30:32 UTC
cvs commit: db-ojb/src/jca/org/apache/ojb/otm/connector OTMJCAManagedConnection.java
mattbaird 2003/08/28 14:30:32
Modified: src/jca/org/apache/ojb/otm/connector
OTMJCAManagedConnection.java
Log:
my mistake, connection events should only fire if the action is not instigated by the application server.
Revision Changes Path
1.4 +4 -4 db-ojb/src/jca/org/apache/ojb/otm/connector/OTMJCAManagedConnection.java
Index: OTMJCAManagedConnection.java
===================================================================
RCS file: /home/cvs/db-ojb/src/jca/org/apache/ojb/otm/connector/OTMJCAManagedConnection.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- OTMJCAManagedConnection.java 20 Aug 2003 17:57:00 -0000 1.3
+++ OTMJCAManagedConnection.java 28 Aug 2003 21:30:32 -0000 1.4
@@ -250,7 +250,6 @@
{
m_tx = m_managedConnectionFactory.getKit().getTransaction(m_connection);
m_tx.begin();
- sendEvents(ConnectionEvent.LOCAL_TRANSACTION_STARTED, null,null);
setManaged(true);
}
catch (TransactionException e)
@@ -277,7 +276,6 @@
{
setManaged(false);
m_tx.commit();
- sendEvents(ConnectionEvent.LOCAL_TRANSACTION_COMMITTED, null,null);
}
catch (TransactionException e)
{
@@ -303,7 +301,6 @@
try
{
m_tx.rollback();
- sendEvents(ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK, null,null);
setManaged(false);
}
catch (TransactionException e)
@@ -335,12 +332,15 @@
* Section 6.5.6 of the JCA 1.5 spec instructs ManagedConnection instances to notify connection listeners with
* close/error and local transaction-related events to its registered set of listeners.
*
+ * The events for begin/commit/rollback are only sent if the application server did NOT
+ * initiate the actions.
+ *
* This method dispatchs all events to the listeners based on the eventType
* @param eventType as enumerated in the ConnectionEvents interface
* @param ex an optional exception if we are sending an error message
* @param connectionHandle an optional connectionHandle if we have access to it.
*/
- private void sendEvents(int eventType, Exception ex, Object connectionHandle)
+ void sendEvents(int eventType, Exception ex, Object connectionHandle)
{
ConnectionEvent ce = null;
if (ex == null)
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org