SenderWorker worker = new SenderWorker(configurationContext,
senderBean, rmsBean.getRMVersion());
worker.setLock(lock);
worker.setWorkId(workId);
// Actually take the lock
lock.addWork(workId, worker);
// Commit the transaction, so that the sender worker starts with a clean state
if (transaction != null && transaction.isActive())
transaction.commit();