private void checkConsisteny(){
+ // System.out.println(Thread.currentThread());
Transaction me = Thread.getTransaction();
if (!me.isActive()) {
+ SpecialLock.getSpecialLock().unlock(me);
throw new AbortedException();
}
- if (me != SpecialLock.getSpecialLock().getOwnerTransaction())
+ if (me != SpecialLock.getSpecialLock().getOwnerTransaction()){
+ // System.out.println("trying to lock " + Thread.currentThread());
SpecialLock.getSpecialLock().lock(me);
+ // System.out.println("locked " + Thread.currentThread());
+ }
if (!me.isActive()) {
SpecialLock.getSpecialLock().unlock(me);
}
finally{
-
+ // System.out.println("here " + Thread.currentThread());
Wrapper.getTransaction().unlockAllLocks();
- if (Thread.getTransaction() == SpecialLock.getSpecialLock().getOwnerTransaction())
+ if (Thread.getTransaction() == SpecialLock.getSpecialLock().getOwnerTransaction()){
+ // System.out.println("herein " + Thread.currentThread());
SpecialLock.getSpecialLock().unlock(Thread.getTransaction());
+ // System.out.println("here");
+
+ }
if (flag == true)
break;
}