ERXJDBCMigrationLock Class Reference

Inherits er::extensions::migration::IERXMigrationLock.

Collaboration diagram for ERXJDBCMigrationLock:

Collaboration graph
[legend]

List of all members.

Public Member Functions

boolean _tryLock (EOAdaptorChannel channel, EOModel model, String lockOwnerName, boolean createTableIfMissing)
void setVersionNumber (EOAdaptorChannel channel, EOModel model, int versionNumber)
boolean tryLock (EOAdaptorChannel channel, EOModel model, String lockOwnerName)
void unlock (EOAdaptorChannel channel, EOModel model)
int versionNumber (EOAdaptorChannel channel, EOModel model)

Static Public Attributes

static final Logger log = Logger.getLogger(ERXJDBCMigrationLock.class)

Protected Member Functions

boolean createIfMissing ()
String dbUpdaterCreateStatement (EOModel model, JDBCAdaptor adaptor)
EOModel dbUpdaterModelWithModel (EOModel model, JDBCAdaptor adaptor)
int initialVersionForModel (EOModel model)
String migrationTableName (JDBCAdaptor adaptor)

Private Attributes

EOModel _dbUpdaterModelCache
EOModel _lastUpdatedModel


Member Function Documentation

boolean _tryLock ( EOAdaptorChannel  channel,
EOModel  model,
String  lockOwnerName,
boolean  createTableIfMissing 
)

boolean createIfMissing (  )  [protected]

String dbUpdaterCreateStatement ( EOModel  model,
JDBCAdaptor  adaptor 
) [protected]

EOModel dbUpdaterModelWithModel ( EOModel  model,
JDBCAdaptor  adaptor 
) [protected]

int initialVersionForModel ( EOModel  model  )  [protected]

String migrationTableName ( JDBCAdaptor  adaptor  )  [protected]

Adds support for overriding the name of the db updater table on a per-database product level.

Parameters:
adaptor the current jdbc adaptor
Returns:
the name of the dbupdater table

void setVersionNumber ( EOAdaptorChannel  channel,
EOModel  model,
int  versionNumber 
)

Sets the current version number of the named model.

Parameters:
channel the adaptor channel associated with this process
model the model to set version information on
versionNumber the new version number

Implements IERXMigrationLock.

boolean tryLock ( EOAdaptorChannel  channel,
EOModel  model,
String  lockOwnerName 
)

Attempts to retrieve a lock on the migration process for the named model. A lockOwnerName is provided that provides a simple mechanism to recover from a stale lock. If the lock owner name passed in matches the current lock owner name, then the lock is acquired.

Parameters:
channel the adaptor channel associated with this process
model the model to try to lock
lockOwnerName the name of the lock owner
Returns:
true if the lock was acquired, false if it was not

Implements IERXMigrationLock.

void unlock ( EOAdaptorChannel  channel,
EOModel  model 
)

Unlocks the given model. This should only be called if you acquired a lock with tryLock(..).

Parameters:
channel the adaptor channel associated with this process
model the model to unlock

Implements IERXMigrationLock.

int versionNumber ( EOAdaptorChannel  channel,
EOModel  model 
)

Returns the current version number of the named model.

Parameters:
channel the adaptor channel associated with this process
model the model to lookup version information on
Returns:
the current version number of the named model

Implements IERXMigrationLock.


Member Data Documentation

EOModel _dbUpdaterModelCache [private]

EOModel _lastUpdatedModel [private]

final Logger log = Logger.getLogger(ERXJDBCMigrationLock.class) [static]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:16 2012 for Project Wonder by  doxygen 1.5.8