|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TableLocking
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 String |
JNDI_NAME
The name, under wich the TableLocking is bound in the jndi. |
| Fields inherited from interface com.sap.engine.frame.core.locking.LockingConstants |
|---|
FILL_CHARACTER, LIFETIME_TRANSACTION, LIFETIME_USERSESSION, MAX_ARGUMENT_LENGTH, MAX_NAME_LENGTH, MAX_OWNER_LENGTH, MAX_USER_LENGTH, MODE_CHECK_EXCLUSIVE_CUMULATIVE, MODE_CHECK_EXCLUSIVE_NONCUMULATIVE, MODE_CHECK_SHARED, MODE_EXCLUSIVE_CUMULATIVE, MODE_EXCLUSIVE_NONCUMULATIVE, MODE_OPTIMISTIC, MODE_OPTIMISTIC_TO_EXCLUSIVE, MODE_SHARED, OWNER_WILDCARD_CHARACTER, WILDCARD_CHARACTER_MULTI, WILDCARD_CHARACTER_SINGLE |
| Method Summary | |
|---|---|
void |
assertLifetime(byte lifetime)
Deprecated. does not work for local transactions |
String |
getCurrentOwner(byte lifetime)
Deprecated. use getCurrentOwner(byte, Connection) instead, because does not work for local transactions |
String |
getCurrentOwner(byte lifetime,
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,
Connection connection,
String tableName,
Map primaryKeys,
char mode)
Creates a lock for a row in a table contained in the specified SQL connection. |
void |
lock(byte lifetime,
Connection connection,
String tableName,
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,
Connection connection,
String tableName,
Map primaryKeys,
char mode)
Releases a lock for a row in a table contained in the specified SQL connection. |
void |
unlock(byte lifetime,
Connection connection,
String tableName,
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,
Connection connection)
Releases all granted locks. |
void |
unlockAll(byte lifetime,
Connection connection,
boolean asynchronous)
Releases all granted locks. |
| Field Detail |
|---|
static final String JNDI_NAME
| Method Detail |
|---|
void lock(byte lifetime,
Connection connection,
String tableName,
Map primaryKeys,
char mode)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
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.
com.sap.engine.frame.core.locking.LockException - if the lock can not be granted.
IllegalArgumentException - if the given primary key map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if an technical error occurred.
void lock(byte lifetime,
Connection connection,
String tableName,
Map primaryKeys,
char mode,
int timeout)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
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 collision
com.sap.engine.frame.core.locking.LockException - if the lock can not be granted.
IllegalArgumentException - if the given primary key map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if an technical error occurred.
void unlock(byte lifetime,
Connection connection,
String tableName,
Map primaryKeys,
char mode)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
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.
IllegalArgumentException - if the given primary key map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if an technical error occurred.
void unlock(byte lifetime,
Connection connection,
String tableName,
Map primaryKeys,
char mode,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
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.
IllegalArgumentException - if the given primary key map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if an technical error occurred.
void unlockAll(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
IllegalArgumentException - if the given lifetime map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if an technical error occurred.
void unlockAll(byte lifetime,
Connection connection)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.connection - The SQL connection instance created by a data source instance
IllegalArgumentException - if the given lifetime map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if an technical error occurred.
which has a corresponding entry in the deployment descriptor of the DB pool.
void unlockAll(byte lifetime,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.asynchronous - If false, then the unlock is done synchronously.
IllegalArgumentException - if the given lifetime map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if an technical error occurred.
void unlockAll(byte lifetime,
Connection connection,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
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.
IllegalArgumentException - if the given lifetime map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if an technical error occurred.
void assertLifetime(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
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.
IllegalArgumentException - if the given lifetime map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if the lifetime is currently not allowed.
NotSupportedException - if called in a local transaction
String getCurrentOwner(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
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.
IllegalArgumentException - if the given lifetime map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if the lifetime is currently not allowed.
NotSupportedException - if called in a local transaction
String getCurrentOwner(byte lifetime,
Connection connection)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
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.
IllegalArgumentException - if the given lifetime map is illegal.
com.sap.engine.frame.core.locking.TechnicalLockException - if the lifetime is currently not allowed.
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.
com.sap.engine.frame.core.locking.TechnicalLockException| Access Rights |
|---|
| SC | DC |
|---|---|
[sap.com] ENGINEAPI
|
[sap.com] applocking
|
[sap.com] ENGFACADE
|
[sap.com] tc/je/locking/api
|
[sap.com] CORE-TOOLS
|
[sap.com] com.sap.engine.client.lib
|
|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||