I am using JBoss Seam and working with transactions. I have 2 methods with the @Transactional annotation.
@Transactional
public void method1()
{
...
entityManager.flush();
}
@Transactional
public void method2()
{
...
entityManager.flush();
}
My problem is that if method1 and method2 are being executed at the same time and method1 ends the transaction, then there will not be any running transactions for method2. How can I solve this? Can I force a transaction to be always active while there is code running on the method, even using manual flushing?