Actually no, and this is what makes it so strange. DataContext is thread-safe for read operations, so multiple threads can access it simultaneously. Transactions are bound to threads, and unbound in the finally block, so overlapping transactions between threads should not be possible, neither are overlapping transactions within a thread.

So anything else special/customized about your transactions? In any event In recommend running your app in debugger and putting a breakpoint in DataDomain.runInTransaction(..) to check what really happens.

Andrus

On Jun 9, 2010, at 12:23 AM, Andrea Pavan wrote:

As you said, the problem persist also with H2, even if it happens many time
less, maybe because H2 executes queries faster.
I synchronized the method for obtaining the thread bounded DataContext, but
the problem still persist.
Have I to synchronize also the method that creates and performs query?

Thanks for help.

*Andrea*

2010/6/9 Andrea Pavan <[email protected]>

No, "Container Managed Transactions" isn't checked.

2010/6/8 Andrus Adamchik <[email protected]>

This seems like a race condition, and I am not sure that switching the DB
fixes it. I just don't understand how it can possibly happen. Do you have
"Container Managed Transactions" set to on by any chance?

Andrus



Reply via email to