-
1. Re: refreshing entity beans
triathlon98 Jul 26, 2004 7:26 AM (in response to ghoyle)This should work as expected "out of the box". You just have to make sure you are using commit option B or C.
Joachim -
2. Re: refreshing entity beans
ghoyle Jul 26, 2004 8:04 AM (in response to ghoyle)I am not sure what you mean by this.
The database can be changed using a web interface that does not go through my J2ee app
I.e. direct database change.
So how does the entity bean detect this?
Or more importantly to me, how do I get my stateful session bean to ask the entity bean if the data has changed in anyway?
Thanks,
Geoff -
3. Re: refreshing entity beans
ghoyle Jul 26, 2004 10:47 AM (in response to ghoyle)Ok, I realise what you mean by commit levels now.
I changed the commit level to option D in the standardjboss.xml
file.
However my enties are still not being refreshed, if I change the data outside of the the
container.
Please see example code, to see if you can see where I am going wrong.public void updateTVBS(java.lang.String sessionID, java.lang.String userID){ Collection tvbslist = new ArrayList(); boolean connected = true; TVBSDetails details = null; try{ ClientDetailsLocal client = clientDetaislHome.findByPrimaryKey(userID); if(!(client.getUserID() == null) && (client.getSessionID().equals(sessionID))){ aTvbsList = new ArrayList(); while(connected == true){ Collection temptvbslist = new ArrayList(); temptvbslist = client.getTVBSList(); Iterator i = temptvbslist.iterator(); while (i.hasNext()) { TVBSLocal tvbs = (TVBSLocal) i.next(); details = new TVBSDetails(tvbs.getIor(), tvbs.getTVBSID().shortValue(),tvbs.getPcoName(),true); tvbslist.add(details); }//while if(aTvbsList.equals(tvbslist)){ System.out.println("In the aTvbsList.equals(tvbslist)"); // do nothing }else{ try{ System.out.println("Calling back the corba wrapper "); callBackRef.callback(tvbslist); aTvbsList = tvbslist ; System.out.println("The tvbs list size is " + tvbslist.size()); }catch(Exception e){ connected = false; } } //Sleep for 5 minutes //Thread.sleep(300000); Thread.sleep(5000); }//while
-
4. Re: refreshing entity beans
albertok Jul 26, 2004 11:56 AM (in response to ghoyle)Option D is rather similar to option A except of bean instances are periodically synchronized at regular intervals, so let's use B or C.