[Biojava-l] Parsing GenBank files in Threads

Hoebeke Mark Mark.Hoebeke at jouy.inra.fr
Thu Apr 1 14:06:18 EST 2004


Hi,

I was wondering if Sequence objects are thread-safe.

In a pipeline I am developing I parse a set of GenBank flat files in
several simultaneously executing threads (one file per thread,
obviously), to feed them in a database.

On execution I get erratic ArrayOutOfBoundsExceptions when invoking the
SimpleSequence.getString() method. The indices in question are mostly
negative. The SimpleSequence instance is created trough a
SequenceIterator obtained  with SeqIOTools.readGenbank().

When I prefix the method making this call with 'static synchronized' the
errors disappear.

I leafed through 6 months worth of mail archives looking for clues, to
no avail.

My guess is that there could be something odd happening in the
SeqIOTools.readGenbank() method, which is declared as a static method.

Any help would be greatly appreciated.

Thanks in advance,

Mark 

-- 
--------------------------Mark.Hoebeke at jouy.inra.fr----------------------
Unité Statistique & Génome                                     Unité MIG
+33 (0)1 60 87 38 03                  Tél.          +33 (0)1 34 65 28 85
+33 (0)1 60 87 38 09                  Fax.          +33 (0)1 34 65 29 01
Tour Evry 2, 523 pl. des Terrasses             INRA - Domaine de Vilvert
F - 91000 Evry                             F - 78352 Jouy-en-Josas CEDEX




More information about the Biojava-l mailing list