• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ejb update , how i can update a record with cmp  RSS feed

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
I know that ejbRemove and ejbCreate create and remove a CMP
but what about updating a cmp ? for example i update some field and then try to store them ?
how i can do that ?
How i can have batch update and batch delete ? i mean deleting a set of records or updating a set of records?

Thank you
 
saisuri kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

ejbCreate(),ejbRemove() are life cycle methods,which are called by the container....

If u want to update the DB....create ur own method in home interface....

if u want batch updates store all queries in one file and execute it by using ResultSet.excuteBatch("");

it may help u...i too also not comfertable with cmp but i am femiliar with bmp...

ok...bye ..
suresh
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If u want to update the DB....create ur own method in home interface....

if u want batch updates store all queries in one file and execute it by using ResultSet.excuteBatch("");

You would never put any persistence code in a CMP entity bean. Look at ejbStore(). This is the method the container uses to synchronize state. For CMP you would not put any persistence code in here - it is Container Managed so let the container do its job. And, since this is a container managed method, you would not call it directly, instead it will be called implicitly it the bean is passivated, or when the transaction your updates were made in is committed.
[ October 10, 2005: Message edited by: Paul Sturrock ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!