Java Code Examples for javax.sql.XAConnection#addStatementEventListener()

The following examples show how to use javax.sql.XAConnection#addStatementEventListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RMXAConnectionResource.java    From FHIR with Apache License 2.0 5 votes vote down vote up
@Override
public void addStatementEventListener(StatementEventListener listener) {
    log.entering(this.getClass().getName(), "addStatementEventListener");
    try {
        // Drive the method calls to each of the proxied XAConnections.
        List<XAConnection> connections = getProxiedXAConnections();
        for (XAConnection connection : connections) {
            connection.addStatementEventListener(listener);
        }
    } finally {
        log.exiting(this.getClass().getName(), "addStatementEventListener");
    }
}
 
Example 2
Source File: XADataSourceImpl.java    From ByteJTA with GNU Lesser General Public License v3.0 5 votes vote down vote up
public XAConnection getXAConnection() throws SQLException {
	XAConnection delegate = this.xaDataSource.getXAConnection();

	XAConnectionImpl managed = new XAConnectionImpl();
	managed.setIdentifier(this.identifier);
	managed.setDelegate(delegate);

	delegate.addConnectionEventListener(managed);
	delegate.addStatementEventListener(managed);

	return managed;
}
 
Example 3
Source File: XADataSourceImpl.java    From ByteJTA with GNU Lesser General Public License v3.0 5 votes vote down vote up
public XAConnection getXAConnection(String user, String password) throws SQLException {
	XAConnection delegate = this.xaDataSource.getXAConnection(user, password);

	XAConnectionImpl managed = new XAConnectionImpl();
	managed.setIdentifier(this.identifier);
	managed.setDelegate(delegate);

	delegate.addConnectionEventListener(managed);
	delegate.addStatementEventListener(managed);

	return managed;
}