Project Wonder 5.0.0.8794

er.extensions.migration
Interface IERXMigrationLock

All Known Implementing Classes:
ERXJDBCMigrationLock

public interface IERXMigrationLock

Because you might be running with multiple instances, there needs to be a locking mechanism that is higher level than just a db context lock. IERXMigrationLock is a simple interface for accessing and locking information about the migration process.

Author:
mschrag

Method Summary
 void setVersionNumber(EOAdaptorChannel channel, EOModel model, int versionNumber)
          Sets the current version number of the named model.
 boolean tryLock(EOAdaptorChannel channel, EOModel model, String lockOwnerName)
          Attempts to retrieve a lock on the migration process for the named model.
 void unlock(EOAdaptorChannel channel, EOModel model)
          Unlocks the given model.
 int versionNumber(EOAdaptorChannel channel, EOModel model)
          Returns the current version number of the named model.
 

Method Detail

versionNumber

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

setVersionNumber

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

tryLock

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

unlock

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

Last updated: Thu, Jan 8, 2009 • 12:32 PM EST

Copyright © 2002 – 2007 Project Wonder.