Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > When do CMP Entity Beans persist data?

Reply
Thread Tools

When do CMP Entity Beans persist data?

 
 
Lord0
Guest
Posts: n/a
 
      08-29-2008
Hi there,

I've inherited a Struts app running on OC4J/Oracle 10g which uses CMP
Entity beans to handle reading/writing data from the DB.

My question is: WHEN does the container write the data in the beans
back to the DB? (I believe it decides "itself" when to do this)

Cheers

Lord0
 
Reply With Quote
 
 
 
 
Donkey Hottie
Guest
Posts: n/a
 
      08-29-2008
Lord0 <(E-Mail Removed)> wrote in news:98393ad7-d293-4c00-9979-
http://www.velocityreviews.com/forums/(E-Mail Removed):

> Hi there,
>
> I've inherited a Struts app running on OC4J/Oracle 10g which uses CMP
> Entity beans to handle reading/writing data from the DB.
>
> My question is: WHEN does the container write the data in the beans
> back to the DB? (I believe it decides "itself" when to do this)
>
> Cheers
>
> Lord0


If there is a session bean managing the entity beans, the transaction
begins when you "enter" a method in that session bean. It ends when you
exit the method.

I think the container have to write the data at least just before the
transaction ends.

 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      08-29-2008
Lord0 wrote:
> I've inherited a Struts app running on OC4J/Oracle 10g which uses CMP
> Entity beans to handle reading/writing data from the DB.
>
> My question is: WHEN does the container write the data in the beans
> back to the DB? (I believe it decides "itself" when to do this)


When the transaction in the EJB container commits succesfully, then
the database update must go through. Even though the EJB specs may
not say how, then I can not see any other way of achieving that
than having the EJB tx commit do a DB tx commit.

The EJB spec also has a little figure that shows a commit to
the database at that point.

With a common EJB config the EJB transaction will commit after the
outermost session bean method call exits before returning to
client.

Also note that if other apps are accessing the data, then you need
to look at the CMP beans deployment descriptor - more specifically
commit option A, B and C.

Arne



 
Reply With Quote
 
Lord0
Guest
Posts: n/a
 
      09-08-2008
thanks for the replies guys
 
Reply With Quote
 
Lord0
Guest
Posts: n/a
 
      09-08-2008
thanks for the replies guys
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to relate a SQL based entity with an Object based entity in Entity Framework markla ASP .Net 1 10-06-2008 09:42 AM
CMP without entity beans ? sc_wizard29@hotmail.com Java 1 07-21-2007 08:35 PM
handy access to attributes of entity beans from session beans Torsten Schmeissel Java 0 04-29-2005 05:19 PM
no cmp field defined in cmp ejb Andrea Sansottera Java 0 07-16-2004 02:24 PM
Entity beans and CMP Tim Java 0 01-30-2004 03:04 AM



Advertisments