Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 62 Insurance
- 536.1K On-Premises Infrastructure
- 138.2K Analytics Software
- 38.6K Application Development Software
- 5.7K Cloud Platform
- 109.4K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.2K Integration
- 41.6K Security Software
Seeking Advice on 3-tier toplink usage

656264
Member Posts: 13
Hi,
I am having a typical web-application flow(JSP -> EJB -> DAO) and had questions around usage of toplink.
I read an object from session using namedQuery in one method..say getMyObject(). And then present the same to user. The user updates the object and I try to persist the same.
From all the mergeClone related posts in the I could find out that for this type of scenario, there are two options:-
- Always read the object using UOW so that we are not working on object from session cache
- OR use session.copyObject method when returning an object for user modification
Please let me know which approach is better from performance point of view.
Regards,
Ani
I am having a typical web-application flow(JSP -> EJB -> DAO) and had questions around usage of toplink.
I read an object from session using namedQuery in one method..say getMyObject(). And then present the same to user. The user updates the object and I try to persist the same.
From all the mergeClone related posts in the I could find out that for this type of scenario, there are two options:-
- Always read the object using UOW so that we are not working on object from session cache
- OR use session.copyObject method when returning an object for user modification
Please let me know which approach is better from performance point of view.
Regards,
Ani
Tagged:
Answers
-
From the performance viewpoint it is best to always read through a Session (or using a read-only query) when you want read-only objects, and read through a UnitOfWork when you want to modify the objects.
----
James : http://www.eclipselink.org
This discussion has been closed.