org.objectweb.jonas_ejb.container
Class JEntitySwitchCRW
java.lang.Object
org.objectweb.jonas_ejb.container.JEntitySwitch
org.objectweb.jonas_ejb.container.JEntitySwitchCST
org.objectweb.jonas_ejb.container.JEntitySwitchCRW
public class JEntitySwitchCRW
- extends JEntitySwitchCST
Container Optimistic lock-policy.
Only 1 thread can write. All other threads can read, without
waiting for a committed state. There is no wait.
This policy cannot be used with shared=true.
This policy is only possible for CMP2 entitybeans.
- Author:
- Philippe Durieux
Fields inherited from class org.objectweb.jonas_ejb.container.JEntitySwitch |
bf, blockedtx, counter, countIH, countIT, deadlockTimeout, estimestamp, FEW_SECONDS, ident, inactivityTimeout, inDirtyList, isdetached, isremoved, lazyregister, local, lockpolicy, mustReload, mustStore, myTimerService, pk, readTimeout, reentrant, remote, runningtx, shared, todiscard, txUpdates, waiters, writingtx |
Methods inherited from class org.objectweb.jonas_ejb.container.JEntitySwitch |
bindICtx, detachPk, discardContext, forceDiscardICtx, getBeanFactory, getBlockingTx, getEntityTimerService, getICtx, getICtx, getLocal, getPolicy, getPrimaryKey, getRemote, init, lazyRegistering, notifyTimeout, notifyWriting, registerCtx, releaseICtx, terminate, txCompleted |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JEntitySwitchCRW
public JEntitySwitchCRW()
- empty constructor. Object is initialized via init() because it is
implemented differently according to jorm mappers.
initpolicy
protected void initpolicy(JEntityFactory bf)
- Overrides:
initpolicy
in class JEntitySwitchCST
waitmyturn
public void waitmyturn(javax.transaction.Transaction tx)
- Wait until I'm allowed to work on this instance.
Transaction isolation may be done here, depending on lock-policy.
- Overrides:
waitmyturn
in class JEntitySwitchCST
- Parameters:
tx
- Transaction
mapICtx
public JEntityContext mapICtx(javax.transaction.Transaction tx,
JEntityContext bctx,
boolean forced,
boolean holdit,
boolean notused)
- Map a context and its instance.
Could use the inherited method here. This is just a simplified
version for performances.
- Overrides:
mapICtx
in class JEntitySwitch
- Parameters:
tx
- - the Transaction objectbctx
- - the JEntityContext to bind if not nullforced
- - force to take this context. (case of create)holdit
- - increment count to hold it, a release will be called
later.notused
- - true if we must check non-reentrance.
- Returns:
- JEntityContext actually mapped