Logo Search packages:      
Sourcecode: qdbm version File versions  Download package

void Villa::tranbegin (  )  throws VillaException [inline]

Begin the transaction.

Exceptions:
VillaException if an error occurs.
Note:
If a thread is already in the transaction, the other threads block until the prius is out of the transaction. Only one transaction can be activated with a database handle at the same time.

Definition at line 610 of file Villa.java.

References index, tran, and tranmonitor.

Referenced by qdbm::VillaTester::run().

                                                {
    if(index < 0) throw new VillaException();
    synchronized(tranmonitor){
      while(tran){
        try {
          tranmonitor.wait();
        } catch(InterruptedException e){
          e.printStackTrace();
          throw new VillaException();
        }
      }
      tran = true;
    }
    synchronized(ADBM.class){
      if(vltranbegin(index) == 0){
        tran = false;
        throw new VillaException(vlecode());
      }
    }
  }


Generated by  Doxygen 1.6.0   Back to index