I've submitted an issue regarding this:
http://glassfish.dev.java.net/issues/show_bug.cgi?id=3032
As i don't think the current behaviour is correct. When making a "FOR UPDATE" query, the EM should treat it as an update and create a new transaction. Also, depending upon how the query is made i get different results.
- Named query with "Pessimistic-Lock" hint always fails
- Native query with a resultClass specified generally creates a transaction but fails occasionally
- Native query with a resultSetMapping seems to always create a transaction (so far)
[Message sent by forum member 'jsl123' (jsl123)]
http://forums.java.net/jive/thread.jspa?messageID=218282