Hi Dan,
I think this is definitely something that needs to be more clearly defined
by the spec. Not to try to play word games to justify WebLogic's
implementation but one could interpret these statements in the spec several
different ways. For example, Section 9.1.5.2 says, as you quoted:
"The container must invoke this method on the instance whenever it becomes
necessary for the instance to synchronize its state in the database with
the state of the instance's fields. This synchronization always happens at
the end of a transaction."
But, since with a read-only bean, it is not necessary for the "instance to
synchronize its state with the database", does that mean that ejbStore does
not need to be called? It really does not say that the container must
invoke this method at the end of every transaction so I guess the question
is what was the intent of the spec writers with regards to this issue.
The second sentence seems to say that synchronization (and thus the
invoking of ejbStore) will always happen at the end of the
transaction. However, as you pointed out, Section 9.1.7 says that:
"The container invokes the ejbStore method at the end of a transaction, and
may also invoke it at other times when the instance is in the ready state."
This could be interpreted as a contradiction of the statement that the
"synchronization always happens at the end of the transaction". I guess my
point is that the specification is not entirely clear on this issue (and it
should be). At this point, I feel that I could argue both sides of this
issue so personally, I don't believe that you could strictly say that this
is in violation of the spec. Hopefully, the spec writers will clear this
up for us...
Just my two cents,
Robert
At 10:30 AM 4/10/00 -0400, Dan OConnor wrote:
>On 10 Apr 00, at 10:11, Louth, William (Exchange) wrote:
>
> > Hi Dan,
> >
> > I think Web Logic is viewing the following statement
> >
> > <specification>
> > 9.4.5 ejbStore
> > When the container needs to synchronize the state of the entity object in
> > the database with the state of
> > the enterprise bean instance, the container first calls the ejbStore()
> > method on the instance, and
> > then it extracts the container-managed fields and writes them to the
> > database.
> > </specification>
> >
> > to mean that they do not have to call ejbStore since they do not have to
> > synch the state.
>
>I think you're probably correct about the reasoning. 9.1.5.2,
>however, is clear:
>
>"The container must invoke this method on the instance whenever
>it becomes necessary for the instance to synchronize its state in
>the database with the state of the instance's fields. This
>synchronization always happens at the end of a transaction."
>
>9.1.7 verifies this:
>
>"The container invokes the ejbStore method at the end of a
>transaction, and may also invoke it at other times when the
>instance is in the ready state."
>
>-Dan
>
> >
> > Can somebody tell me has this feature ever got in the way of their ejb
> > programming i.e. they needed this callback for some obscure reason not
> > related directly to persistence.
> >
> > William Louth
> >
> > > -----Original Message-----
> > > From: Dan OConnor [SMTP:[EMAIL PROTECTED]]
> > > Sent: Monday, April 10, 2000 2:19 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Unneeded calls to ejbStore
> > >
> > > I'm sorry, William. I just realized that in both examples you were
> > > talking about not calling ejbStore. On first reading, I thought you
> > > were referring to the ejbLoad behavior in the "read-only cache"
> > > example. My bad!
> > >
> > > You are correct; this is a violation of the specification.
> > >
> > > -Dan
> > >
> > > >
> > > >
> > > > On 10 Apr 00, at 8:40, Louth, William (Exchange) wrote:
> > > >
> > > > >
> > > > > read-only cache strategy
> > > > >
> > > > > The read-only cache strategy can be used for entity EJBs that are
> > > never
> > > > > modified by an EJB client, but may be updated periodically by an
> > > external
> > > > > source. For example, a read-only entity EJB may be used to
> represent a
> > > stock
> > > > > quote for a particular company, which is updated externally to the
> > > WebLogic
> > > > > Server system.
> > > > >
> > > > > WebLogic Server never calls ejbStore() for a read-only entity EJB.
> > > ejbLoad()
> > > > > is called initially when the EJB is created; afterwards, WebLogic
> > > Server
> > > > > calls ejbLoad() only at intervals defined by the read-timeout-seconds
> > > > > deployment parameter.
> > > > >
> > > > The read-only cache strategy does not violate the specification.
> > > > Section 9.1.1.0 specifically allows this behavior as commit option
> > > > "A":
> > > >
> > > > "The Container caches a ready instance between transactions. The
> > > > Container ensures that the instance has exclusive access to the
> > > > state of the object in the persistent storage. Therefore, the
> > > > Container does not have to synchronize the instance's state from
> > > > the persistent storage at the beginning of the next transaction."
> > > >
> > > > The timeout-interval is clearly allowed because the server is
> > > > allowed to call ejbLoad at any "arbitrary" time, according to the
> > > > specification.
> > > >
> > > > -Dan
> > > >
> > > >
> > >
> > >
> ==========================================================================
> > > =
> > > 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".
> >
> >
> > ***********************************************************************
> > Bear Stearns is not responsible for any recommendation, solicitation,
> > offer or agreement or any information about any transaction, customer
> > account or account activity contained in this communication.
> > ***********************************************************************
> >
> > ===========================================================================
> > 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".