If you want to save an object fetched before in the same life cycle of the server, Castor long transaction support can solve your problem, just implements Timestampable. You can check Castor Homepage or source code test.TestPersistent.java. If your object is persisted somewhere outside server lifecycle, I guess your approach is the only choice, however, you need to add a Timestamp column in the table to do dirty check yourself. Regards ------------ Zhongling "Alex" Li -----Original Message----- From: Chris Audley [mailto:[EMAIL PROTECTED]] Sent: Friday, August 31, 2001 2:35 PM To: [EMAIL PROTECTED] Subject: [castor-dev] Stateless Session EJB design pattern I'm trying to determine the best way to use Castor JDO from a Stateless Session bean. Tips and experiences would be appreciated. I have a sizable collection of Stateless EJBs for managing database objects which typically have methods like findByXX which return data objects and save() which commit any changes. Right now, these EJB's use straight JDBC, but I would like to switch to Castor to improve maintainability. The findByXX methods are easy, just get an instance of the DB object through Castor and return it to EJB client. However, how do I implement the save method? Should I refetch the DB object then change any fields that are different than the object from the client, or is there a why to directly pass the object to Castor for writing. Or is there a better design than using a pair of methods to find and save? Cheers Chris ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
