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.


Field Summary
static String JNDI_NAME
           
 
Method Summary
 void lock(byte lifetime, Connection connection, EntityBean lockingArgument, char mode)
          Creates a lock for a row in a table, accessible through the specified SQL connection.
 void unlock(byte lifetime, Connection connection, EntityBean lockingArgument, char mode)
          Releases a lock for a row in a table, accessible through the specified SQL connection.
 void unlock(byte lifetime, Connection connection, 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 String JNDI_NAME
See Also:
Constant Field Values
Method Detail

lock

public void lock(byte lifetime,
                 Connection connection,
                 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,
                   Connection connection,
                   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,
                   Connection connection,
                   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.


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.