The container will call ejbStore whenever it believes the bean's
state needs to be synchronized with the persistent store.  This
typically, but not necessarily, happens on transaction boundaries.

Servers can provide optimizations that will allow them to detect that
a synchronization is not necessary, e.g. when a method is read-
only.  These optimizations are server-specific.  Simply marking the
method as not supporting a transaction can not provide the server
with enough information to make this optimization in a spec-
compliant way.

According to the spec, the ejbLoad and ejbStore methods will
execute in the transaction context of the business method.  If this
business method's context is specified as NotSupported, Never, or
Supports (under certain conditions), the ejbStore and ejbLoad
methods will run with "an unspecified transaction context."  This
simply means that the container can implement the execution of
the method, and access to resource managers, in a manner of its
choosing.  The ejb specification does not prescribe specifically
how.  For instance, the container may treat each call of an
instance to a resource manager as a single transaction, or it may
merge multiple calls to that resource manager into one transaction.

Marking a business method as "NotSupported" does not mean that
the method does not modify its state.

-Dan



On 9 Apr 00, at 9:55, Frank Sauer wrote:

> try setting the transaction property of the gentile method
> to TX_NOT_SUPPORTED. ejbStore is called each time a transaction
> commits, in this case the container probably start a transaction
> just before the genrile method is called (is ejbLoad being called?)
> and commits it just afterwards.
>
> Frank Sauer
> The Technical Resource Connection
> Tampa, Fl
> http://www.trcinc.com
>
> > -----Original Message-----
> > From: A mailing list for Enterprise JavaBeans development
> > [mailto:[EMAIL PROTECTED]]On Behalf Of DaveFord
> > Sent: Sunday, April 09, 2000 1:42 AM
> > To: [EMAIL PROTECTED]
> > Subject: Unneeded calls to ejbStore
> >
> >
> > The following block of code generates a customer pick list.
> > It only READS
> > from the database and does NOT WRITE to the database.
> > However, I have added
> > a println to CompanyBean's ejbStore method and it reports
> > that ejbStore is
> > being called five times (once for each time through the while
> > loop). Why is
> > ejbStore being called?
> >
> > Iterator it = companyHome.findByName("Wal").iterator();
> > while(it.hasNext()){
> >   Company comp = (Company)it.next();
> >   System.out.println( comp.gentile() );
> > }
> >
> > Thanks,
> >
> > Dave Ford
> >
> > ==============================================================
> > =============
> > To unsubscribe, send email to [EMAIL PROTECTED] and
> > include in the body
> > of the message "signoff EJB-INTEREST".  For general help,
> > send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
> >
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to