SAP J2EE Engine

Version 6.40


com.sap.engine.interfaces.ejb.locking
Interface EJBLocking


public interface EJBLocking

This interfase is used by CMP entity beans, which require explicit managing of the Enqueue locking, instead of using the implicit locking mechanisms of the EJB Container. Uses the TableLocking API.

Version:
%I%, %G%

Field Summary
static java.lang.String JNDI_NAME
           
 
Method Summary
 void lock(byte lifetime, java.sql.Connection connection, javax.ejb.EntityBean lockingArgument, char mode)
          Creates a lock for a row in a table, accessible through the specified SQL connection.
 void unlock(byte lifetime, java.sql.Connection connection, javax.ejb.EntityBean lockingArgument, char mode)
          Releases a lock for a row in a table, accessible through the specified SQL connection.
 void unlock(byte lifetime, java.sql.Connection connection, javax.ejb.EntityBean lockingArgument, char mode, boolean asynchronous)
          Releases a lock for a row in a table, accessible through the specified SQL connection.
 void unlockAll(byte lifetime)
          Releases all locks.
 void unlockAll(byte lifetime, boolean asynchronous)
          Releases all locks.
 

Field Detail

JNDI_NAME

public static final java.lang.String JNDI_NAME
Method Detail

lock

public void lock(byte lifetime,
                 java.sql.Connection connection,
                 javax.ejb.EntityBean lockingArgument,
                 char mode)
          throws EJBLockException
Creates a lock for a row in a table, accessible through the specified SQL connection. The row corresponds to the CMP entity bean argument 'lockingArgument'.
Parameters:
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.
lockingArgument - The CMP entity bean, whose corresponding row in the database must be locked.
mode - The mode can be MODE_SHARED, MODE_EXCLUSIVE_CUMULATIVE, or MODE_EXCLUSIVE_NONCUMULATIVE.
Throws:
EJBLockException - if the lock is not allowed.

unlock

public void unlock(byte lifetime,
                   java.sql.Connection connection,
                   javax.ejb.EntityBean lockingArgument,
                   char mode)
Releases a lock for a row in a table, accessible through the specified SQL connection. The row corresponds to the CMP entity bean argument 'lockingArgument'.
Parameters:
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.
lockingArgument - The CMP entity bean whose corresponding row in the database must be locked.
mode - The mode can be MODE_SHARED, MODE_EXCLUSIVE_CUMULATIVE, or MODE_EXCLUSIVE_NONCUMULATIVE.

unlock

public void unlock(byte lifetime,
                   java.sql.Connection connection,
                   javax.ejb.EntityBean lockingArgument,
                   char mode,
                   boolean asynchronous)
Releases a lock for a row in a table, accessible through the specified SQL connection. The row corresponds to the CMP entity bean argument 'lockingArgument'.
Parameters:
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.
lockingArgument - The CMP entity bean whose corresponding row in the database must be locked.
mode - The mode can be MODE_SHARED, MODE_EXCLUSIVE_CUMULATIVE, or MODE_EXCLUSIVE_NONCUMULATIVE.
asynchronous - If false, the unlock is done synchronously.

unlockAll

public void unlockAll(byte lifetime)
Releases all locks. By default, the unlock can be done asynchronously (depends on the Enqueue server configuration).
Parameters:
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.

unlockAll

public void unlockAll(byte lifetime,
                      boolean asynchronous)
Releases all locks. By default, the unlock can be done asynchronously (depends on the Enqueue server configuration).
Parameters:
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
asynchronous - If false, the unlock is done synchronously.

SAP J2EE Engine

Version 6.40


Copyright © 2001-2005 SAP AG. All Rights Reserved.