Matt, Thanks for the quick reply. I've done some Google searching and regarding the commit issue I've found an answer by Gavin King. According to Gavin's reply in this post: http://forum.hibernate.org/old/911225.html and this 'common problem' answer: http://hibernate.bluemars.net/116.html on the Hibernate website, you will need to commit the JDBC connection if you do not call Transaction.commit().
In general it seems to me that there are two strategies: using transactions or not using transactions. If you want to use transactions you should let the transactions close the JDBC connection and not close it explicitly. The conclusion would therefore be that the CRUD methods in the BaseDAOHibernate class shouldn't close the JDBC connection and instead let the DAOHibernate classes (that extend the BaseDAOHibernate class) worry about wrapping their calls to the CRUD methods in Hibernate transactions. Just make sure that you remind the developers of the fact that removeObject, storeObject and saveObject do not do all the work for them. Thomas -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Matt Raible Envoye : jeudi 11 decembre 2003 23:37 A : [EMAIL PROTECTED] Cc : [EMAIL PROTECTED] Objet : [Struts-apps] RE: Questions regarding the AppFuse implementation Thomas, I've cc'd the struts-apps mailing list - this is probably a better place to post these questions so they'll get more visibility and picked up by google. 1. I took the commits out of the save methods because I believe ses.flush() is doing the same thing. I could be wrong - you might want to check with the hibernate folks. I only modify these when they're giving me issues - you could try removing the commits and see what happens. 2. It think this depends. If your DAOs are mostly using the methods in BaseDAOHibernate, you might add your tr ansactions there. In the apps I've developed, I generally don't use Transactions much because I haven't had a need (yet). Hope this helps. Please let me know if you find a better way to do things in the DAOs, I'll be more than happy to add your enhancements. Matt > -----Original Message----- > From: Thomas Nicholls [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 11, 2003 2:55 PM > To: [EMAIL PROTECTED] > Subject: Questions regarding the AppFuse implementation > > > Hi Matt, > > We're using AppFuse for a project and we have a couple of > questions regarding the implementation. I don't know whether > there is a proper mailinglist dedicated to issues such as > ours, but I can't seem to find the answers to our question by > searching on Google. If you have a few minutes I would really > appreciate any input you might have. Here are the questions: > > 1. In the class BaseDAOHibernate you have the CRUD methods. I > guess the idea is that the DAOHibernate classes should extend > this class (just like you have done with UserDAOHibernate) > and then call the CRUD methods on the BaseDAOHibernate super > class. In the removeObject method in the BaseDAOHibernate > class you end with 'ses.connection().commit();', whereas in > the storeObject method you do not call commit. Why is that > and what do you recommend we do? > > 2. Where do you propose we handle the Hibernate transactions? > Should it be in the DAOs or would a higher level be more appropriate? > > By the way, thanks for a good blog and the JSPWiki tips they > are definitely useful! > > Regards, > Thomas > ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Struts-apps mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/struts-apps ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Struts-apps mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/struts-apps
