users@glassfish.java.net

Re: JPA - entityManager.flush()

From: <glassfish_at_javadesktop.org>
Date: Thu, 17 May 2007 11:49:55 PDT

I hope this is not going too far out of the thread's scope :)

1. how do I handle each task in its own transaction? are transactions in EJBs start/end at the begining/end of the method? so am I must implement a method that handles one/X tasks per method call? or I can start/end transactions somehow as a part of my method body?

2. that's the main thing here - assuming I have a table with tasks, when task is an entity, is there any way to determine all the tasks that are locked as a part of the JSQL query? or I must load the tasks and then check by the EM if they are locked or not?


It takes about 1 minute to handle each task, and I have about 10-50 tasks per second, that means I must have some concurrent threads for the scanners to handle task processing while each thread(scanner) should handle X tasks.


Many many thanks
[Message sent by forum member 'trouby' (trouby)]

http://forums.java.net/jive/thread.jspa?messageID=217702