|
SAP J2EE Engine Version 6.40 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Provides methods to lock and unlock rows in database tables. The database table belongs to the given connection. The locks may be in the context of a local transaction, a JTA transaction or an user session. All locks are removed automatically when the session/transaction ends.
LogicalLocking| Field Summary | |
static java.lang.String |
JNDI_NAME
The name, under wich the TableLocking is bound in the jndi. |
| Method Summary | |
void |
assertLifetime(byte lifetime)
Deprecated. does not work for local transactions |
java.lang.String |
getCurrentOwner(byte lifetime)
Deprecated. use getCurrentOwner(byte, Connection) instead, because does not work for local transactions |
java.lang.String |
getCurrentOwner(byte lifetime,
java.sql.Connection connection)
Returns the current owner-id, to which all locks belong. |
long |
getUniqueIncreasingNumber()
Returns a number with the following properties: every method-call returns a higher number than the previous ones the number contains the timestamp of the central server, so this will work correctly in a distrubuted environment and also after a restart of the cluster This number can be used for every purpose, it is not locking-specific. |
void |
lock(byte lifetime,
java.sql.Connection connection,
java.lang.String tableName,
java.util.Map primaryKeys,
char mode)
Creates a lock for a row in a table contained in the specified SQL connection. |
void |
lock(byte lifetime,
java.sql.Connection connection,
java.lang.String tableName,
java.util.Map primaryKeys,
char mode,
int timeout)
Creates a lock for a row in a table contained in the specified SQL connection. |
void |
unlock(byte lifetime,
java.sql.Connection connection,
java.lang.String tableName,
java.util.Map primaryKeys,
char mode)
Releases a lock for a row in a table contained in the specified SQL connection. |
void |
unlock(byte lifetime,
java.sql.Connection connection,
java.lang.String tableName,
java.util.Map primaryKeys,
char mode,
boolean asynchronous)
Releases a lock for a row in a table contained in the specified SQL connection. |
void |
unlockAll(byte lifetime)
Deprecated. use unlockAll(byte, Connection) instead, because does not work for local transactions |
void |
unlockAll(byte lifetime,
boolean asynchronous)
Deprecated. use unlockAll(byte, Connection, boolean) instead, because does not work for local transactions |
void |
unlockAll(byte lifetime,
java.sql.Connection connection)
Releases all granted locks. |
void |
unlockAll(byte lifetime,
java.sql.Connection connection,
boolean asynchronous)
Releases all granted locks. |
| Field Detail |
public static final java.lang.String JNDI_NAME
| Method Detail |
public void lock(byte lifetime,
java.sql.Connection connection,
java.lang.String tableName,
java.util.Map primaryKeys,
char mode)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.connection - The SQL connection instance created by a data source instance
which has a corresponding entry in the deployment descriptor of the DB pool.
in the deployment descriptor of the DB pool.tableName - The unqualified name of a table contained in the SQL connection.primaryKeys - Contains primary key column names to primary key value mappings.mode - The mode can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.LockException - if the lock can not be granted.java.lang.IllegalArgumentException - if the given primary key map is illegal.TechnicalLockException - if an technical error occurred.
public void lock(byte lifetime,
java.sql.Connection connection,
java.lang.String tableName,
java.util.Map primaryKeys,
char mode,
int timeout)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.connection - The SQL connection instance created by a data source instance
which has a corresponding entry in the deployment descriptor of the DB pool.
in the deployment descriptor of the DB pool.tableName - The unqualified name of a table contained in the SQL connection.primaryKeys - Contains primary key column names to primary key value mappings.mode - The mode can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.timeout - time period in milliseconds within this the lock will be requested several times if there is a lock collisionLockException - if the lock can not be granted.java.lang.IllegalArgumentException - if the given primary key map is illegal.TechnicalLockException - if an technical error occurred.
public void unlock(byte lifetime,
java.sql.Connection connection,
java.lang.String tableName,
java.util.Map primaryKeys,
char mode)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.connection - The SQL connection instance created by a data source instance
which has a corresponding entry in the deployment descriptor of the DB pool.tableName - The unqualified name of a table contained in the SQL connection.primaryKeys - Contains primary key column to primary key value mappings.mode - The mode can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.java.lang.IllegalArgumentException - if the given primary key map is illegal.TechnicalLockException - if an technical error occurred.
public void unlock(byte lifetime,
java.sql.Connection connection,
java.lang.String tableName,
java.util.Map primaryKeys,
char mode,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.connection - The SQL connection instance created by a data source instance
which has a corresponding entry in the deployment descriptor of the DB pool.tableName - The unqualified name of a table contained in the SQL connection.primaryKeys - Contains primary key column to primary key value mappings.mode - The mode can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.asynchronous - If false, then the unlock is done synchronously.java.lang.IllegalArgumentException - if the given primary key map is illegal.TechnicalLockException - if an technical error occurred.
public void unlockAll(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.java.lang.IllegalArgumentException - if the given lifetime map is illegal.TechnicalLockException - if an technical error occurred.
public void unlockAll(byte lifetime,
java.sql.Connection connection)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.connection - The SQL connection instance created by a data source instancejava.lang.IllegalArgumentException - if the given lifetime map is illegal.TechnicalLockException - if an technical error occurred.
which has a corresponding entry in the deployment descriptor of the DB pool.
public void unlockAll(byte lifetime,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.asynchronous - If false, then the unlock is done synchronously.java.lang.IllegalArgumentException - if the given lifetime map is illegal.TechnicalLockException - if an technical error occurred.
public void unlockAll(byte lifetime,
java.sql.Connection connection,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.connection - The SQL connection instance created by a data source instance
which has a corresponding entry in the deployment descriptor of the DB pool.asynchronous - If false, then the unlock is done synchronously.java.lang.IllegalArgumentException - if the given lifetime map is illegal.TechnicalLockException - if an technical error occurred.
public void assertLifetime(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
This method is typically not needed to use the locking. It is meant mainly for debugging-purposes and to support better tracing.
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.java.lang.IllegalArgumentException - if the given lifetime map is illegal.TechnicalLockException - if the lifetime is currently not allowed.NotSupportedException - if called in a local transaction
public java.lang.String getCurrentOwner(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
This method is not needed to use the locking. It is meant mainly for debugging-purposes and to support better tracing.
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.java.lang.IllegalArgumentException - if the given lifetime map is illegal.TechnicalLockException - if the lifetime is currently not allowed.NotSupportedException - if called in a local transaction
public java.lang.String getCurrentOwner(byte lifetime,
java.sql.Connection connection)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
This method is not needed to use the locking. It is meant mainly for debugging-purposes and to support better tracing.
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.connection - The SQL connection instance created by a data source instance
which has a corresponding entry in the deployment descriptor of the DB pool.java.lang.IllegalArgumentException - if the given lifetime map is illegal.TechnicalLockException - if the lifetime is currently not allowed.
public long getUniqueIncreasingNumber()
throws com.sap.engine.frame.core.locking.TechnicalLockException
ATTENTION: if the system-time of the central server is changed this will probably not work correctly any more.
|
SAP J2EE Engine Version 6.40 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||