On Dec 13, 2012, at 12:27 PM, "Howard W. Smith, Jr." <[email protected]> 
wrote:

> David,
> 
> Yes, please refer to the following (and see what I wrote at the beginning
> of that comment), thanks.
> 
> https://issues.apache.org/jira/browse/OPENEJB-1968#comment-13531442
> 

So first note, the @TransactionAttribute(value = 
TransactionAttributeType.NEVER) and @TransactionAttribute(value = 
TransactionAttributeType.REQUIRES_NEW) were two aspects of the same suggestion.

Second note is, were I in your shoes, the very first thing I'd do is revert all 
the @ApplicationScoped and @Asychronous stuff and go back to the code that only 
took 2 minutes -- I seem to recall that before it jumped to 30 minutes there 
was a version that ran faster (2 minute range).

Third, all versions of the code posted have the same flaw as the original code 
-- there is only one transaction for processing all emails.  This is the 
fundamental problem and there is no possible solution that involves *adding* 
code and not changing this one fundamental flaw.  This is why when you added 
the code that waited for a safe time to do the processing it made things worse 
-- it was too late a transaction was already started and the database tables 
already locked.

We can definitely get this working better, but the problem is there is simply 
too much code happing in one transaction.  No other fix will help.

If you're willing to go back to the original version of the code and do *only* 
the suggestions given, I think we can get this easily sorted out today.

Thoughts?


-David

Reply via email to