JpaLockingStrategy as of 3.4.11.@Deprecated public class JdbcLockingStrategy extends Object implements LockingStrategy, org.springframework.beans.factory.InitializingBean
This class requires a backing database table to exist based on the following template:
CREATE TABLE LOCKS ( APPLICATION_ID VARCHAR(50) NOT NULL, UNIQUE_ID VARCHAR(50) NULL, EXPIRATION_DATE TIMESTAMP NULL ); ALTER TABLE LOCKS ADD CONSTRAINT LOCKS_PK PRIMARY KEY (APPLICATION_ID);
Note that table and column names can be controlled through instance properties, but the create table script above is consistent with defaults.
JpaLockingStrategy| Modifier and Type | Class and Description |
|---|---|
static class |
JdbcLockingStrategy.DatabasePlatform
Deprecated.
Supported database platforms provides support for platform-specific
behavior such as locking semantics.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_LOCK_TIMEOUT
Deprecated.
Default lock timeout is 1 hour
|
| Constructor and Description |
|---|
JdbcLockingStrategy()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquire()
Deprecated.
Attempt to acquire the lock.
|
void |
afterPropertiesSet()
Deprecated.
|
void |
release()
Deprecated.
Release the lock if held.
|
void |
setApplicationId(String id)
Deprecated.
|
void |
setApplicationIdColumnName(String name)
Deprecated.
|
void |
setDataSource(DataSource dataSource)
Deprecated.
|
void |
setExpirationDateColumnName(String name)
Deprecated.
|
void |
setLockTimeout(int seconds)
Deprecated.
|
void |
setPlatform(JdbcLockingStrategy.DatabasePlatform platform)
Deprecated.
|
void |
setTableName(String name)
Deprecated.
|
void |
setUniqueId(String id)
Deprecated.
|
void |
setUniqueIdColumnName(String name)
Deprecated.
|
public static final int DEFAULT_LOCK_TIMEOUT
public void setUniqueId(String id)
id - Identifier used to identify this instance in a row of the
lock table. Must be unique across all clients vying for
locks for a given application ID.public void setApplicationId(String id)
id - Application identifier that identifies a row in the lock
table for which multiple clients vie to hold the lock.
This must be the same for all clients contending for a
particular lock.public void setLockTimeout(int seconds)
seconds - Maximum amount of time in seconds lock may be held.public void setTableName(String name)
name - Name of database table holding locks.public void setApplicationIdColumnName(String name)
name - Name of database column that stores application ID.public void setUniqueIdColumnName(String name)
name - Name of database column that stores unique ID.public void setExpirationDateColumnName(String name)
name - Name of database column that stores lock expiration date.public void setDataSource(DataSource dataSource)
dataSource - JDBC data source.public void setPlatform(JdbcLockingStrategy.DatabasePlatform platform)
platform - Database platform that indicates when special syntax
is needed for database operations.public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean@Transactional public boolean acquire()
LockingStrategyacquire in interface LockingStrategyLockingStrategy.acquire()@Transactional public void release()
LockingStrategyrelease in interface LockingStrategyLockingStrategy.release()Copyright © 2004-2012 Jasig. All Rights Reserved.