I think this link to the current EntityManager documentation is usefull
http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/transactions.html
I understand that the spec is still under development but it now states that it uses Optimistic Locking, which is with the current Hibernate Entity Manager not the case. If I take a default MS SQL SRV2000 + jTDS + Resource Local EntityManager my test waits for the previous transaction to close. This is not what the spec says:
In 3.3.5 Optimistic Locking and Concurrency
This specification assumes the use of "optimistic locking". It assumes that the databases to which persistence
units are mapped will be accessed by implementations using read-committed isolation (or a
vendor equivalent in which long-term read locks are not held), and that writes to the database typically
occur only when the flush method has been invoked—whether explicitly by the application, or by the
persistence provider runtime in accordance with the FlushMode settings. If a transaction is active, a
compliant implementation of this specification is permitted to write to the database immediately (i.e.,
whenever a managed entity is updated, created, and/or removed), however, the configuration of an
implementation to require such non-deferred database writes is outside the scope of this specification.
The configuration of the setting of optimistic lock modes is described in section 3.3.5.3. Applications
that prefer the use of pessimistic locking may require that database isolation levels higher than
read-committed be in effect. The configuration of the setting of such database isolation levels, however,
is outside the scope of this specification.
(The whole chapter 3.3 of the Proposed Final Draft makes for interesting reading about this subject. If you don't have it, get it here:
http://www.jcp.org/en/jsr/detail?id=220