Juergen

I think you may need to check how you have defined the transactional
behaviour of your beans. This will dictate when the entity beans load and
store data.

-----Original Message-----
From: Lorenz_JBoss [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 08, 2000 12:29 PM
To: 'jBoss'
Subject: [jBoss-User] Two instances of one entity?


Hi,
I have written an entity bean with tho finder methods:
findByPrimaryKey(String id) and findByCommission(String c).
For findByCommission I have defined a SQL-statement in jaws.xml.

To access the entities, the client provides some methods which uses
different finders.

But, if I change values of an entity which was found by findByCommission,
and then use findByPrimaryKey to access that entity again, I see none of my
previous changings!

I found a possible workaround: if I have to use findByCommission to access
an entity, I do it this way:

        Enumeration e = findByCommission(c);
        while(e.hasMoreElements()) {
          Commission com = (Commission)e.nextElement();
          com = CommissionHome.findByPrimaryKey(com.getID());
        ...

In the log then I saw, jBoss does first two ejbLoad calls and after doing my
changings, two ejbStore calls. 
One of the ejbStore calls contains the original unchanged values and the
other the changings - but both with the same primary key!

Any ideas?

Juergen



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to