Seam 2.2, Jboss 6.1, hibernate 3.5.6 and MSQL Server 2008
and have such a function.
public void deliverFile() {
EntityManager jobbEntityManager = (EntityManager)Component.getInstance("jobbEntityManager");
JobbStatusInterface jobbStatus = new JobbStatus();
jobbStatus.setStatus(PluginStatus.INITIATED);
jobbEntityManager.persist(jobbStatus);
jobbStatus.setStatus(PluginStatus.DONE);
jobbEntityManager.flush();
}
public void checkJobb(){
EntityManager jobbEntityManager = (EntityManager)Component.getInstance("jobbEntityManager");
jobbEntityManager.createQuery("from JobbStatus", JobbStatus.class).getResultList();
}
I have a poll on checkJobb every 10 seconds, so if the deliveryFile () function is executed.
checkJobb is the upp queue and stops in the request, so when the deliveryFile () functions end, it completes all 6 checkJobbs () at once.
Even if I select directly from the database, it is locked and completes its request after delivery of File ().
Anyway, to do this so that I can execute my checkJobb () while deliveryFile is running?
Trind source
share