If I understand what is going on, this was recently fixed by Bill Burke. I
think the 2.4.? ?beta? versions include the fix, don't know about 2.2.?
david jencks
On 2001.07.04 09:05:23 -0400 Andre Vermeulen@i-Commerce wrote:
> Hi
>
> I am experiencing the following problem while doing updates and
> subsequent
> finds on entity beans. The scenario is as follows:
>
> In my code I first find an object via primary key, I then update a field
> or
> two and call setData on the remote interface for the object. If I then do
> another find by PK the changed/dirty object is returned and checking in
> the
> log file reveals that a pooled object is returned i.e. there was no DB
> access. If I then call a finder method that should return this changed
> object, amongst others, e.g. a findAll I do not get the changed/dirty
> object
> but rather one representing the committed data on the DB, for this step
> the
> log file shows DB access as expected.
>
> here is a short code example, that interacts with the entity bean:
>
> TrailerHome trailerHome =
> (TrailerHome)EJBUtil.getBeanHome(TrailerHome.JNDI_NAME);
> Trailer trailerRemote = trailerHome.findByPrimaryKey(trailerPK);
> TrailerData trailerData = trailerRemote.getData();
>
> // change a property
> trailerData.setColour("purple");
>
> //update trailer
> trailerRemote.setData(trailerData);
>
> // do search by PK, this returns "dirty" object
> Trailer pkResult = railerHome.findByPrimaryKey(trailerPK);
>
> // do a search for everything, this does not return the "dirty"
> object
> Collection allTrailers;
> allTrailers = trailerHome.findAll();
>
> Has anybody got any ideas as to what I am doing wrong, if anything, or is
> this what should be happening. In the above example I could obviously put
> the update and find in different transactions but for what I am working
> on I
> need to do an update followed by a find, that includes the changes, and
> then
> an update elsewhere in a single transaction.
>
> thanks
>
>
>
> **********************************************************************
>
> The information in this e-mail is confidential and is legally privileged.
> It is intended solely for the addressee. If this email is not intended
> for
> you, you cannot copy, distribute, or disclose the included information
> to any-one
>
> If you are not the intended recipient please delete the mail. Whilst
> all reasonable steps have been taken to ensure the accuracy and
> integrity of all data transmitted electronically, no liability is
> accepted
> if the data, for whatever reason, is corrupt or does not reach it's
> intended destination.
> All business is undertaken, subject to our standard trading conditions
> which are available on request.
>
> *******************************************************************
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user