Are you using container (CMP) or bean (BMP) managed persistence?
I'm new to this but it seems that you would need to use BMP since
you should only instantiate a single instance of the entity bean
regardless of the find method used to access the bean.
comments?
-----Original Message-----
From: Lorenz_JBoss [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 08, 2000 9:29 AM
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]