Guardians, Tenants, NIO 2, BPM, Docker and Service Discovery, or 26th

New record: >130 viewers from all over the world watched live the 26th edition of discussing questions from various topics:

Any questions left? Ask now: and join the conversation at each first Monday of the month at 6 P.M. live. No registration or any other commitment required.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home:


using EntityManager in @ViewScoped bean is a terrible idea. In a clustered setup, EM will try to be serialized to other cluster nodes, which will fail miserably and will cause session loss.
I use a CDI EM producer pattern and inject that instead. It's serializable and because it @ApplicationScoped, and call a get method on that to get an appropriate EM from the @ViewScoped bean.

Posted by Lenny Primak on May 11, 2016 at 05:33 PM CEST #

Batch fetching is very useful JPA optimization technique. It's used to solve N+1 issues in an efficient manner, when as opposed to join fetch, you need to retrieve multiple rows (@OneToMany) where you can retrieve using IN (1,2,3,4) etc. instead of using multiple select statements one by one

Posted by Lenny Primak on May 11, 2016 at 05:54 PM CEST #


thanks! I mentioned fetch joins in earlier airhacks editions. I was not aware that Fetch Joins are also known under the name "Batch Fetching".

Fetch Joins are very useful:

FROM Department d LEFT JOIN FETCH d.employees
WHERE d.deptno = 1

(from the spec, chapter,

thanks and see you next month!,



Posted by on May 11, 2016 at 07:07 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments