If Bean E's work can complete separately from what A & B are doing, then you
could set the transaction property on Bean E to TX_REQUIRES_NEW, which would
force an ejbStore.

If E's update to the database and B's query are closely related, you could
move B's work into E and use bean-managed persistence.

I certainly wouldn't say you cannot mix EBs and SBs, but if they are
touching the same data you have to be careful to avoid problems like the one
you are having.  You are lucky--if WebLogic's implementation wrote through
more often, your code would have worked for now, and mysteriously failed
later on some other container or version.

Stuart Halloway
DevelopMentor
http://www.develop.com/hp/halloway

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Williams
> Sent: Monday, February 21, 2000 12:51 PM
> To: [EMAIL PROTECTED]
> Subject: Problem mixing Session Beans and Entity Beans
>
>
> I have a problem.
>
> We have a servlet (S) that calls a session-bean (A) to perform an update.
> Bean A uses an entity-bean (E) to update the status of a database entity
> (let's call it Thing), then calls another session-bean (B) to get
> a list of
> Things with a particular status.  Bean B accesses the database directly,
> using JDBC.
>
> We're expecting the Thing that was just updated to be included in
> this list,
> but it's not.  Seems that the problem is that the EJB container (WebLogic)
> does not call E.ejbStore() before B does it's query.  The EJB
> spec suggests
> that this is quite normal behaviour ... just a shame that we didn't
> understand it before.
>
> So, what to do??  Seems that we either have to pick either
> session-beans OR
> entity-beans to perform database-access, and not try to mix the two.  Is
> that a valid conclusion?
>
> Recommendations?
>
> --
> Mike Williams
> http://www.o3.co.uk
>

===========================================================================
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