Hi All,

Okay, I'm doing a bunch of genetic research with JBoss. Our principal 
investigator (my Boss), wants to store many many thousands of records 
in the database and I have been trying to write the code that inserts 
all of those records in the 'background' while users might be 
operating the Struts based Web UI at the same time.

I've now tried JBoss 3.2.2, 3.2.3, and 3.2.4RC1 with varying results. 
3.2.2 throws quite a few Deadlock detected exceptions. 3.2.3 and 
3.2.4RC1 (from CVS yesterday) does something similar.

Here's what I'm doing. I have a Message Driven Bean that receives a 
message with the primary key of an Experiment. Experiments have 
Samples, Samples have Replicates, and Replicates have Files. I 
basically get a list of all of the File entities in an Experiment 
inside my MDB, by opening a UserTransaction, doing the work, and then 
committing the transaction.

Once I have all of my File entities in a list, I open each file and 
read a bunch of GeneExpression data out of them. I have created a 
Stateless Session Bean with a method on with a Transaction type of 
'RequiresNew', into which I pass the data values for a single record, 
as well as a reference to a Replicate which that record needs to be 
associated. The MDB is not in a transaction at that point, but the 
SLSB creates a transaction to handle the database update. The update 
doesn't take very long, but there are roughly 15,000 of them per 
file. It can take a couple of minutes to finish adding them all.

Now the problem: The web interface is useable during this time if and 
only if the Replicate object isn't accessed by anyone during the 
processing of the file. If it is, either the addition of the 
GeneExpression record to the Replicate will fail (a simple 
record.setReplicate(replicateRef)) or the transaction started in the 
web application will fail and the user is presented with a message 
about the transaction being rolled back.

I'd prefer not to see either of these messages. How can I avoid this? 
Is the problem that I'm holding onto the Replicate reference across 
transactions? Should I constantly be looking it up again?

The reason for my MDB -> SLSB with RequiresNew transaction is to allow 
the web application to be functional during this long-term data 
insertion, otherwise the web application will block on the long-term 
transaction. So I've basically set up fine-grained transactions. But 
I still get conflicts.

Shouldn't a transaction be queued until all others finish? Is it 
because I'm really creating a lot of transactions with my insertions, 
that the web transaction doesn't get a chance to get processed and 
times out? I have my jboss transaction-timeout set to the default of 
300 (is that seconds)? That should be sufficient, I'd think.

Are there any other designs that support mass insertion in the 
background with JBoss? At this point, I want to avoid having to use 
something like Hibernate, just for consistency sake.

Do I need to use something like Commit Option B for this kind of 
thing? I hope not... I like having a cache.

Thanks in advance.

-Neal



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to