Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-22-2009, 07:08 PM
Member
 
Join Date: Oct 2009
Posts: 16
Rep Power: 0
CatchSandeepVaid is on a distinguished road
Default EntityManager.refresh() works only on managed entities.
Why can't EntityManager.refresh() work on detatched entities? Any reason behind this ?
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-23-2009, 07:00 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,760
Rep Power: 2
r035198x is on a distinguished road
Default
If the EntityManager is container managed and of type PersistenceContextType.TRANSACTION then a transaction is required. Otherwise how does the implementation know which database to refresh from?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-05-2009, 01:11 PM
Member
 
Join Date: Oct 2009
Posts: 16
Rep Power: 0
CatchSandeepVaid is on a distinguished road
Default
Agreed.. transaction is required but what it has to do with detatched instance ?
Moreover:
P-331 says : "We use the method to undo changes made by the ItemManager client and return fresh entity data from the database."
but when we call merge() (before refresh()), the changes made by the client will get reflected in the database.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application-Managed EntityManager transaction type must be RESOURCE_LOCAL CatchSandeepVaid Enterprise JavaBeans 1 11-23-2009 06:56 PM
sound works then stops! smileii CLDC and MIDP 0 09-26-2009 01:06 AM
No Persistence provider for EntityManager JavaForums Java Blogs 0 09-05-2008 02:10 PM
Container Managed Persistence Java Tip Java Tips 0 12-27-2007 11:16 AM
org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.2.0.CR1 Heather Database 2 06-30-2007 04:01 PM


All times are GMT +2. The time now is 06:28 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org