• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Ejb update , how i can update a record with cmp

 
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Pay attention! Tiny ad!
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic