Methods Summary |
---|
public java.sql.Connection | getConnection(java.lang.Object resource, java.lang.String username, java.lang.String password)Called in a managed environment to get a Connection from the application
server specific resource. In a non-managed environment returns null as
it should not be called.
This is a generic implementation for the case of javax.sql.DataSource as
the resource type.
java.sql.Connection rc = null;
if (resource instanceof javax.sql.DataSource) {
javax.sql.DataSource ds = (javax.sql.DataSource)resource;
if (username == null) {
rc = ds.getConnection();
} else {
rc = ds.getConnection(username, password);
}
}
return rc;
|
public java.lang.String | getDDLNamePrefix(java.lang.Object info)Returns name prefix for DDL files extracted from the info instance by the
application server specific code.
return DEFAULT_STRING;
|
public abstract javax.transaction.TransactionManager | getLocalTransactionManager()Called in a managed environment to access a TransactionManager
for managing local transaction boundaries and registering synchronization
for call backs during completion of a local transaction.
|
public abstract java.sql.Connection | getNonTransactionalConnection(java.lang.Object resource, java.lang.String username, java.lang.String password)Called in a managed environment to get a non-transactional Connection
from the application server specific resource.
|
public abstract javax.transaction.Transaction | getTransaction()Identify the Transaction context for the calling thread, and return a
Transaction instance that can be used to register synchronizations,
and used as the key for HashMaps. The returned Transaction must implement
equals() and hashCode() based on the global transaction id.
All Transaction instances returned by this method called in the same
Transaction context must compare equal and return the same hashCode.
The Transaction instance returned will be held as the key to an
internal HashMap until the Transaction completes. If there is no transaction
associated with the current thread, this method returns null.
|
public abstract javax.transaction.UserTransaction | getUserTransaction()Returns the UserTransaction associated with the calling thread. If there
is no transaction currently in progress, this method returns null.
|
public boolean | isManaged()Identifies the managed environment behavior. // NOI18N
if (System.getProperty(
ClassLoaderStrategy.PROPERTY_MULTIPLE_CLASS_LOADERS) == null)
ClassLoaderStrategy.setStrategy(
ClassLoaderStrategy.MULTIPLE_CLASS_LOADERS_RELOAD);
return true;
|
public void | postInvoke(java.lang.Object im)Called at the end of the Transaction.beforeCompletion() to
de-register the component with the app server if necessary.
The parameter is the return value from preInvoke, and can be any
Object.
|
public java.lang.Object | preInvoke(java.lang.Object component)Called at the beginning of the Transaction.beforeCompletion() to
register the component with the app server only if necessary.
The component argument is an array of Objects.
The first element is com.sun.jdo.spi.persistence.support.sqlstore.Transaction
object responsible for transaction completion.
The second element is com.sun.jdo.api.persistence.support.PersistenceManager
object that has been associated with the Transaction context for the
calling thread.
The third element is javax.transaction.Transaction object that has been
associated with the given instance of PersistenceManager.
The return value is passed unchanged to the postInvoke method.
return null;
|
public void | registerApplicationLifeCycleEventListener(ApplicationLifeCycleEventListener listener)
|
public void | registerSynchronization(javax.transaction.Transaction jta, javax.transaction.Synchronization sync)Called in a managed environment to register internal Synchronization object
with the Transaction Synchronization. If available, this registration
provides special handling of the registered instance, calling it after
all user defined Synchronization instances.
jta.registerSynchronization(sync);
|
public com.sun.jdo.api.persistence.support.PersistenceManagerFactory | replaceInternalPersistenceManagerFactory(com.sun.jdo.api.persistence.support.PersistenceManagerFactory pmf)Replace newly created instance of PersistenceManagerFactory
with the hashed one if it exists. The replacement is necessary only if
the JNDI lookup always returns a new instance. Otherwise this method
returns the object passed to it as an argument.
PersistenceManagerFactory is uniquely identified by
ConnectionFactory.hashCode() if ConnectionFactory is
not null; otherwise by ConnectionFactoryName.hashCode() if
ConnectionFactoryName is not null; otherwise
by the combination of URL.hashCode() + userName.hashCode() +
password.hashCode() + driverName.hashCode();
return pmf;
|
public void | setPersistenceManagerFactoryDefaults(com.sun.jdo.api.persistence.support.PersistenceManagerFactory pmf)Set environment specific default values for the given PersistenceManagerFactory.
In most app servers optimistic and retainValues flags should be false.
For any other settings this method should be overritten.
pmf.setOptimistic(false);
pmf.setRetainValues(false);
|
public int | translateStatus(int st)Translate local representation of the Transaction Status to
javax.transaction.Status value if necessary. Otherwise this method
should return the value passed to it as an argument.
This method is used during afterCompletion callbacks to translate
the parameter value passed by the application server to the
afterCompletion method. The return value must be one of:
javax.transaction.Status.STATUS_COMMITTED or
javax.transaction.Status.STATUS_ROLLED_BACK .
return st;
|
public java.sql.Statement | unwrapStatement(java.sql.Statement stmt)This method unwraps given Statement and return the Statement from
JDBC driver if possible.
return stmt;
|