Does it really take place immediately? I always thought it to take place at the end of 
the
transaction, which is given either through one of these:
a) Transaction timeout
b) Manually end of transaction, if applied
c) End of caller's method, if caller is an SB
d) Immediately, if caller is a client application and no user managed transaction is 
applied

What sense does it make to immediately post every SET directly into the DBMS, if there 
is a
transaction used, that will become rolled back some time? This will only lead to poorer
performance. I can imagine only one scenario where this would make sense: If you have 
no
transaction isolation on DBMS transactions and want to access the current (!) value at 
any time
directly from the DBMS. But for what are you using transaction (->ACID) then?


> Hi all,
>
> I just wanted to let you know (whoever might be
> interested in it), that even if you use a database
> like MySQL, that does _NOT_ support transactions,
> it does make sense to set the <trans-attribute>
> in the deployment-descriptor to "Required".
>
> The reason is, that, as soon as you use a set-Method
> on a CMP-Entity Bean, the update to the DB takes
> place immediately, while - as Philippe described before -
> when you have "NotSupported" in the <trans-attribute>,
> you don't have this update, which is IMO not intuitive.
>
> Stephan
>
> Philippe Durieux schrieb:
> >
> > Stephan Bauer wrote:
> > >
> > > Hi,
> > >
> > > another short question:
> > >
> > > I have deployed my CMP-Entity-EJBs successfully.
> > > In my TestClient, I have the following code:
> > >
> > >    AddressHome home = (AddressHome) initialContext.lookup(beanName);
> > >    Address addr = home.create(new Integer(3));
> > >    addr.setCity("Straubing");
> > >    addr.setCountry("Deutschland");
> > >    ...
> > >    ...
> > >
> > > But in my Database, the newly inserted row consists only
> > > of the id, which I provided with the create-Method, all
> > > the other fields are NULL.
> > > Is there anything else I have to do to make the
> > > CMP-Entity-Bean synchronize with the Database ?
> > > I thought, that in CMP, I don't have to do something
> > > in ejbStore(), because the synchronization is done by
> > > the container...?
> > >
> > > [PS: the <trans-attribute> is set to "NotSupported" in
> > > the deployment desc., because I'm using MySQL ! ]
> > >
> > > Thanks,
> > >
> > > Stephan
> > You are not using transactions. In this case, entity beans
> > will be written in the database only when one of these event
> > occur:
> > - you stop the server. (JonasAdmin -s)
> > - you unload your container (JonasAdmin -r ...)
> > - a transaction is started on your bean instance (not your case)
> > - you run manually JonasAdmin -sync
> > - you have defined a non null passivation timeout in your bean deployment
> >   descriptor:
> >
> >     <jonas-entity>
> >       <ejb-name>Item</ejb-name>
> >       <passivation-timeout>5</passivation-timeout>
> >       .....
> >     </jonas-entity>
> >
> > In all other cases, the bean state is kept in memory for efficiency.
> >
> > --
> > Philippe Durieux  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Bull - 1 rue de Provence - 38432 Echirolles Cedex France
> > [EMAIL PROTECTED]
> > -> Download our EJBServer at http://www.evidian.com/ejb <-
> > ----
> > To unsubscribe, send email to [EMAIL PROTECTED] and
> > include in the body of the message "unsubscribe jonas-users".
> > For general help, send email to [EMAIL PROTECTED] and
> > include in the body of the message "help".
>
> --
> _________________________________________________________________________
>
>    Stephan Bauer, Dipl. Inform. (FH)                  IT-Freelancer
>    Siemensstr. 46                             Bauer Internetprojects.de
>    D-94315 Straubing                          Tel.:  +49 9421 9749549
>    E-Mail: [EMAIL PROTECTED]    Fax:   +49 9421 9749550
>    http://www.internetprojects.de             Mobil: +49 172  9795002
>
>               Software-Design, Implementation & Webhosting
> _________________________________________________________________________
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
>
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]

Reply via email to