[Biojava-l] BioSQL transaction control

Thomas Down td2 at sanger.ac.uk
Fri May 21 04:34:03 EDT 2004


On 21 May 2004, at 06:55, mark.schreiber at group.novartis.com wrote:

> Hi -
>
> I'm going to start using BioSQL fairly intensively soon and I was
> wondering at what level the biojava bindings to biosql control
> transactions. Specifically: if I get a reference to a Sequence object 
> from
> my SequenceDB does that reference lock the underlying entry (entries) 
> in
> the database or does it just give me a local copy to play with and then
> release the lock on the DB?

Neither.

The code supports lazy loading, otherwise it would be easy to make it 
explode on anything remotely resembling a large sequence, so the 
Sequence objects you get back are dependent on the database.  On the 
other hand, the schema is too complex to realistically consider 
"locking" a sequence.  So you should only really have one 
BioSQLSequenceDB accessing a database at a given time.

If you need multiple applications accessing the database at once, can 
you put them all in a single appserver so that they can share a single 
BioSQLSequenceDB?  Otherwise, reasonable options are:

     - Having one server export an object-oriented view of the 
BioSQLSequenceDB to other application (Corba/SOAP/RMI/whatever). 
[Aside: it would be really nice to have some kind of client-server view 
on BioJava.  If this was biojava-specific rather than trying to make it 
an interoperability point (like BioCorba/bsane/etc.) it might actually 
be usable]

     - When you need a sequence, lock the database, get the sequence out 
of BioSQL, copy it into an in-memory object, then release the lock.

     - Hack the BioSQL code to disable lazy loading.

Without knowing a lot more about your applications, I'm not really in a 
position to say which of these are more appropriate.

       Thomas.



More information about the Biojava-l mailing list