• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

database write question?

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
excuse me if this is a silly question...

when actually is the write to the database done ?
is it after the postEJBCreate() with all those setters methods() ...the client would not start any transaction in this case...so no commit
when is the write done if the client starts a transaction and then commits?
this question should not arise if i write any piece of code.......
thanks
pradeep
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pradeep,
In case of Entity bean it will be Container managed transaction so there wont be case of client starting transaction
Database write will be done once ejbCreate() is executed and before ejbPostCreate() because in ejbPostCreate() you will be able to take care of ejb-relationships(This you can not do unless there is record in parent table) and you need to have primary key set before your ejbCreate() method execution completes.
Hope this helps
Sunil
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To my best knowledge, the data is written to the database right after ejbCreate() callback by the container. Databases can have committed or uncommitted data, so the committion time does not really affect the database writing process.
Use search engine (Google etc.) to find more information about database isolation levels (READ_COMMITTED etc.).
 
pradeep arum
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Sunil..it helped a lot
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic