The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

tmpsa (16) [Avatar] Offline
#1
One thing that is not (I beleive) mentioned much in the book is what you can do - and not do - inside an @Entity Property getter method. And the spec appears to be silent on the issue as well.

I had the brilliant idea to do some sorting inside an @Entity property getter method. (I had to sort on some related entities as well, so @OrderBy wouldn't do).

But that caused my fine application to crash and burn.

Turns out that the getter is (in some magical, mysterious, and concurrent way) called by the persistense provider itself in the same @Stateless EJB business method transaction, causing really weird exceptions.

See http://java.net/jira/browse/GLASSFISH-15477

One wonders if this is a bug or a feature in Glassfish.