Top Description Fields Constructors Methods
org.hsqldb.jdbc.pool

public Class JDBCXADataSource

extends JDBCCommonDataSource
implements XADataSource, Serializable, Referenceable, CommonDataSource
Class Inheritance
All Implemented Interfaces
javax.sql.CommonDataSource, javax.naming.Referenceable, java.io.Serializable, javax.sql.XADataSource
Imports
java.io.Serializable, java.sql.SQLException, java.util.HashMap, .HashSet, .Iterator, java.util.concurrent.locks.ReentrantReadWriteLock, javax.naming.NamingException, .Reference, .Referenceable, .StringRefAddr, javax.sql.CommonDataSource, .XAConnection, .XADataSource, javax.transaction.xa.Xid, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.jdbc.JDBCCommonDataSource, .JDBCConnection, .JDBCDriver, .JDBCUtil

Connection factory for JDBCXAConnections. For use by XA data source factories, not by end users.

The org.hsqldb.jdbc.JDBCDataSourceFactory can be used to get instances of this class.

The methods of the superclass, org.hsqldb.jdbc.JDBCCommonDataSource, are used for settings the HyperSQL server and user.

Author
Blaine Simpson (blaine dot simpson at admc dot com)
Since
HSQLDB 2.0.0
Version
2.3.3
See Also
javax.sql.XADataSource, org.hsqldb.jdbc.pool.JDBCXAConnection

Field Summary

Modifier and TypeField and Description
private ReentrantReadWriteLock
private HashMap<Xid, JDBCXAResource>
Inherited from org.hsqldb.jdbc.JDBCCommonDataSource:
connectionPropsdataSourceNamedescriptionloginTimeoutlogWriternetworkProtocolpasswordserverNameurluser

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addResource(Xid xid, JDBCXAResource xaResource)

pack-priv Xid[]
getPreparedXids()

Return the list of transactions currently in prepared or heuristically completed states.

public Reference

Returns:

The non-null javax.naming.Reference of this object.
getReference
()

Implements javax.naming.Referenceable.getReference.

Retrieves the Reference of this object.

pack-priv JDBCXAResource
getResource(Xid xid)

This is needed so that XAResource.commit() and XAResource.rollback() may be applied to the right Connection (which is not necessarily that associated with that XAResource object).

public XAConnection
getXAConnection()

Implements javax.sql.XADataSource.getXAConnection.

Get new XAConnection connection, to be managed by a connection manager.

public XAConnection
getXAConnection(String
String which must match the 'user' configured for this JDBCXADataSource.
user
,
String
String which must match the 'password' configured for this JDBCXADataSource.
password
)

Implements javax.sql.XADataSource.getXAConnection.

Gets a new XAConnection after validating the given username and password.

public JDBCXAResource
Inherited from org.hsqldb.jdbc.JDBCCommonDataSource:
getDatabasegetDatabaseNamegetDataSourceNamegetDescriptiongetLoginTimeoutgetLogWritergetNetworkProtocolgetParentLoggergetServerNamegetUrlgetURLgetUsersetDatabasesetDatabaseNamesetLoginTimeoutsetLogWritersetPasswordsetPropertiessetUrlsetURLsetUser

Field Detail

lockback to summary
private ReentrantReadWriteLock lock
resourcesback to summary
private HashMap<Xid, JDBCXAResource> resources

Constructor Detail

JDBCXADataSourceback to summary
public JDBCXADataSource() throws SQLException

Method Detail

addResourceback to summary
public void addResource(Xid xid, JDBCXAResource xaResource)
getPreparedXidsback to summary
pack-priv Xid[] getPreparedXids()

Return the list of transactions currently in prepared or heuristically completed states. Need to find out what non-prepared states they are considering heuristically completed.

See Also
javax.transaction.xa.XAResource#recover(int)
getReferenceback to summary
public Reference getReference() throws NamingException

Implements javax.naming.Referenceable.getReference.

Retrieves the Reference of this object.

Returns:Reference

The non-null javax.naming.Reference of this object.

Exceptions
NamingException:
If a naming exception was encountered while retrieving the reference.
getResourceback to summary
pack-priv JDBCXAResource getResource(Xid xid)

This is needed so that XAResource.commit() and XAResource.rollback() may be applied to the right Connection (which is not necessarily that associated with that XAResource object).

See Also
javax.transaction.xa.XAResource#commit(Xid, boolean), javax.transaction.xa.XAResource#rollback(Xid)
getXAConnectionback to summary
public XAConnection getXAConnection() throws SQLException

Implements javax.sql.XADataSource.getXAConnection.

Get new XAConnection connection, to be managed by a connection manager.

Exceptions
SQLException:
on error
getXAConnectionback to summary
public XAConnection getXAConnection(String user, String password) throws SQLException

Implements javax.sql.XADataSource.getXAConnection.

Gets a new XAConnection after validating the given username and password.

Parameters
user:String

String which must match the 'user' configured for this JDBCXADataSource.

password:String

String which must match the 'password' configured for this JDBCXADataSource.

Exceptions
SQLException:
on error
See Also
getXAConnection()
removeResourceback to summary
public JDBCXAResource removeResource(Xid xid)