it's a really odd one, the only place we use toString is in the passivation
engines (store to file) so you are looking at something else besides the
cache.

Find what's screwed up it is an interesting one,

marcf

|-----Original Message-----
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of
|Vincent Harcq
|Sent: Thursday, July 05, 2001 3:51 PM
|To: [EMAIL PROTECTED]
|Subject: RE: [JBoss-dev] container-cache-conf 1/1
|
|
|Wow it's an old one.
|I solve my problem by adding a toString() method to the PK class.
|I don't see the reason why it helped me but it does.
|For some reason the get() on the cache (with the ID, this is the
|PK) can not
|find an existing bean and load a new one (see "Activated bean MasterDO" in
|the log).
|I don't understand a lot on JBoss internal but I thought a Map lookup was
|using the hashCode() method, not the toString() method.
|
|> -----Message d'origine-----
|> De : [EMAIL PROTECTED]
|> [mailto:[EMAIL PROTECTED]]De la part de
|> Vincent Harcq
|> Envoyé : jeudi 5 juillet 2001 13:04
|> À : [EMAIL PROTECTED]
|> Objet : RE: [JBoss-dev] container-cache-conf 1/1
|>
|>
|> Hi,
|> Please read this example.
|> It is simpler that the previous one.
|> I don't understand why I am the only one to complain on that.
|>
|> MyService is a SessionBean.  It is a facade the the entity bean.
|> Master is en EntityBean accessed with a Detail object through the session
|> bean.
|>
|> I attach the ejb jar, the Client and the sources.
|>
|> The problem is the (*) that activate a second instance from the cache.
|>
|>
|>
|>
|> Client Code :
|> =============
|>             // Create the Master
|>             MasterDetail master = new MasterDetail("","");
|>             MyService s = shome.create();
|>             master = s.addMaster(master);
|>             s.remove();
|>
|>             // Modify the Master
|>             String timestamp = Long.toString((new
|> java.util.Date()).getTime());
|>             System.out.println("Change to "+timestamp);
|>             master.setName(timestamp);
|>             s = shome.create();
|>             s.modifyMaster(master.getPk(),master);
|>             s.remove();
|>
|>             s = shome.create();
|>     (*)
|> System.out.println("Good:"+s.findMaster(master.getPk()).getName());
|>             s.remove();
|>
|>             // Modify the Master a second time
|>             timestamp = Long.toString((new java.util.Date()).getTime());
|>             System.out.println("Change to "+timestamp);
|>             master.setName(timestamp);
|>             s = shome.create();
|>             s.modifyMaster(master.getPk(),master);
|>             s.remove();
|>
|>             s = shome.create();
|>
|> System.out.println("Bad:"+s.findMaster(master.getPk()).getName());
|>             s.remove();
|>
|>             // Modify the Master a third time
|>             timestamp = Long.toString((new java.util.Date()).getTime());
|>             System.out.println("Change to "+timestamp);
|>             master.setName(timestamp);
|>             s = shome.create();
|>             s.modifyMaster(master.getPk(),master);
|>             s.remove();
|>
|>             s = shome.create();
|>
|> System.out.println("Bad:"+s.findMaster(master.getPk()).getName());
|>             s.remove();
|>
|> Result on Client :
|> ==================
|> go
|> Change to 994329289172
|> Good:994329289172
|> Change to 994329289253
|> Bad:994329289172
|> Change to 994329289323
|> Bad:994329289172
|> end
|>
|> Result on Server :
|> ==================
|> [com.hm.test.jboss.ejb.ServiceBean       ] (45 ) - Executing addMaster
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (81 ) - ejbCreate
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (45 ) -
|> setpk=34ee66:e7829fb74c:-7ffd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (46 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (59 ) - setname=
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (60 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (73 ) - setdescription=
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (74 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (37 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (101) - Executing getDetails
|> 34ee66:e7829fb74c:-7ffd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (51 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (65 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (37 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.ServiceBean       ] (101) - Executing
|> modifyMaster(34ee66:e7829fb74c:-7ffd,com
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (133) - Executing setDetails
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (59 ) - setname=994330842494
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (60 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (73 ) - setdescription=
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (74 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.ServiceBean       ] (101) - Executing
|> modifyMaster(34ee66:e7829fb74c:-7ffd,com
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (133) - Executing setDetails
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (59 ) - setname=994330842535
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (60 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (73 ) - setdescription=
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (74 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.ServiceBean       ] (83 ) - Executing
|> findMaster:com.hm.test.jboss.interfaces.
|> [MasterDO                                ] (61 ) - Activated
|bean MasterDO
|> with id = com.hm.test.jbos
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (37 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@1cc014
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (101) - Executing getDetails
|> 34ee66:e7829fb74c:-7ffd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (51 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@1cc014
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (65 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@1cc014
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (37 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@1cc014
|> [com.hm.test.jboss.ejb.ServiceBean       ] (101) - Executing
|> modifyMaster(34ee66:e7829fb74c:-7ffd,com
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (133) - Executing setDetails
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (59 ) - setname=994330842655
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (60 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (73 ) - setdescription=
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (74 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@28e0bd
|> [com.hm.test.jboss.ejb.ServiceBean       ] (83 ) - Executing
|> findMaster:com.hm.test.jboss.interfaces.
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (37 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@1cc014
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (101) - Executing getDetails
|> 34ee66:e7829fb74c:-7ffd
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (51 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@1cc014
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (65 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@1cc014
|> [com.hm.test.jboss.ejb.MasterDOBean      ] (37 ) -
|> this=com.hm.test.jboss.ejb.MasterDOCMP@1cc014
|>
|>
|> Again please help...
|>
|>
|
|
|_________________________________________________________
|Do You Yahoo!?
|Get your free @yahoo.com address at http://mail.yahoo.com
|
|
|_______________________________________________
|Jboss-development mailing list
|[EMAIL PROTECTED]
|http://lists.sourceforge.net/lists/listinfo/jboss-development



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

Reply via email to