> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of David
> Esposito
> Sent: Monday, June 18, 2001 8:36 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-dev] ejbStore() delay seems to be a serious problem
>
>
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Bill
> > Burke
> > Sent: Sunday, June 17, 2001 10:23 AM
> >
> > 1. Change JBoss to expose a flush method.
> >
> > A.setAddress(newAddress)
> > ((ImaginaryJBossEntityProxy)A).flush(); // Causes an ejbStore()/Update.
> > oldAddress.remove();
>
> This might be the best solution ... as it minimizes the 'smoke
> and mirrors'
> factor that solution #2 presents ... (if people need to sync with the
> database, let them do it explicitly ... don't do it implictly ... )
>
> >
> > 2. Or, as I think somebody else suggested:
> >
> > A.setAddress(newAddress)
> > AHome.findByPrimaryKey(new APK(A.getId())); // causes a ejbStore/Update.
> > oldAddress.remove();
>
> This should be a fine solution too ... I tried this just to make sure that
> it didn't already work ... sadly, it doesn't cause any data to get written
> out ... Ideally, it should do a read from the DB too ... just to make sure
> that no data has been modified by other processes (yes, i use commit B)
> since the start of the transaction ...
>

Doesn't work??!! Are you sure you have the latest JBoss from source?  I put
this "ejbStore on ejbFind" in last week .  Anyways, don't forget, ejbStore
will ONLY be called on entities of the same type of the finder and that are
within the same transaction.

> >
> > 3. Even better, have all your entity beans implement flush(),
> just in case
> > the ejb spec or jboss comes up with a better solution you can
> > easily change
> > it.
> >
> > // CMP
> > class YourBean implements EntityBean
> > public void flush() throws RemoteException
> > {
> >     home.findByPrimaryKey(new MyPK(this.getId());
> > }
> >
> > // BMP: Is this a good solution?
> >
> > class YourBean implements EntityBean
> > public void flush() throws RemoteException
> > {
> >     this.ejbStore();  // Will this work?
> > }
> >
>
> I think that for BMP, that will actually work ... since you're calling a
> method with implementation from within the same object, it should
> work just
> fine.
>
> Ok, so now the million dollar question ... :) ... is there any chance that
> this can get stuck into 2.3/2.4? or is this a big deal that can't be
> implemented in time? ... We are coming up against a launch date for our
> project and this is really important ...
>

Shouldn't be that hard to do, just a question whether or not its something
Mr. Fleury wants within JBoss.  Personnally, I think something like flush
should be added.  Or maybe a better name ejbFlush or jbossFlush.  I may be
able to implement it if I can find the time this week and we can patch it,
BUT...We're coming up against a launch date as well!!!


> Should I add this to the "bug database" (even though it's not a bug, per
> say) ?...
>

Personally I think it is a bug.  It can cause some nasty problems,
especially with your CASCADE DELETE scenario!  Imagine hitting that in
production??!!

Bill



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to