Re: Handle Hibernate transaction in wicket
I use Spring's OpenSessionInViewFilter 2008/2/19, Andrew Williams [EMAIL PROTECTED]: I use onBeginRequest and onEndRequest from the WebRequestCycle, seems to work well. Andy On 13 Feb 2008, at 07:59, Sébastien Piller wrote: Hello, I'm searching for a best practice to integrate some hibernate transaction with Wicket. I'd like to implement the session-per- request that is described here http://www.hibernate.org/hib_docs/v3/reference/fr/html_single/#tutorial-firstapp-workingpersistence I think I can commit the transaction and close the session on the onAfterRender method. But where is the best place to start it? On the first line of the constructor? Or in the onBeforeRender (I think not)? Anywhere else? And what about the ajax queries? I need to recreate a new transaction for each ajax request, need I? Thank you a lot for your think :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29
Re: Handle Hibernate transaction in wicket
It sounds like you're looking for transaction-per-request and not session-per-request. The session-per-request part is easy. Just use the OpenSessionInViewFilter from Spring (as stated by someone else on this thread). The OpenSessionInViewFilter doesn't begin a transaction for you automatically. It merely opens the session and closes it for you. On 2/13/08, Sébastien Piller [EMAIL PROTECTED] wrote: Hello, I'm searching for a best practice to integrate some hibernate transaction with Wicket. I'd like to implement the session-per-request that is described here http://www.hibernate.org/hib_docs/v3/reference/fr/html_single/#tutorial-firstapp-workingpersistence I think I can commit the transaction and close the session on the onAfterRender method. But where is the best place to start it? On the first line of the constructor? Or in the onBeforeRender (I think not)? Anywhere else? And what about the ajax queries? I need to recreate a new transaction for each ajax request, need I? Thank you a lot for your think :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handle Hibernate transaction in wicket
see blog tutorial on howto set this up with wicket...:) Martijn Lindhout wrote: I use Spring's OpenSessionInViewFilter 2008/2/19, Andrew Williams [EMAIL PROTECTED]: I use onBeginRequest and onEndRequest from the WebRequestCycle, seems to work well. Andy On 13 Feb 2008, at 07:59, Sébastien Piller wrote: Hello, I'm searching for a best practice to integrate some hibernate transaction with Wicket. I'd like to implement the session-per- request that is described here http://www.hibernate.org/hib_docs/v3/reference/fr/html_single/#tutorial-firstapp-workingpersistence I think I can commit the transaction and close the session on the onAfterRender method. But where is the best place to start it? On the first line of the constructor? Or in the onBeforeRender (I think not)? Anywhere else? And what about the ajax queries? I need to recreate a new transaction for each ajax request, need I? Thank you a lot for your think :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handle Hibernate transaction in wicket
Thank you all for your ideas. At the moment, I handle it manually (transaction and session), and until now, I don't got much problems. I don't want to use anything from spring, as it seems a lot more difficult than anything else in my project. I've put a closeSession on the onAfterRender method, and every part of my code that use the DB are properly surrounded with transactions... I don't have any problem, and even if it is a bit slower than a best practice, it's enough for me ;) -- View this message in context: http://www.nabble.com/Handle-Hibernate-transaction-in-wicket-tp15451303p15590755.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handle Hibernate transaction in wicket
Once you get used to Spring, you'll really appreciate it. I wouldn't write it off as too difficult if I were you. It's definitely worth learning (and it helps your resume; it's in high demand). On 2/20/08, Pills [EMAIL PROTECTED] wrote: Thank you all for your ideas. At the moment, I handle it manually (transaction and session), and until now, I don't got much problems. I don't want to use anything from spring, as it seems a lot more difficult than anything else in my project. I've put a closeSession on the onAfterRender method, and every part of my code that use the DB are properly surrounded with transactions... I don't have any problem, and even if it is a bit slower than a best practice, it's enough for me ;) -- View this message in context: http://www.nabble.com/Handle-Hibernate-transaction-in-wicket-tp15451303p15590755.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handle Hibernate transaction in wicket
Yes, I read a bit about Spring some time ago, but atm I'm working on a project that will be released soon. I can't afford to rewrite half my code on the lasts weeks ;) Next time, I'll take some time to getting started with it. I'm sure it's worth, that's what I read all the day. But I must consider my colleagues, too... They are not very very interested with dev, and already have difficulties to write php... so, with Spring, they will shot themselves :) Thx James Carman a écrit : Once you get used to Spring, you'll really appreciate it. I wouldn't write it off as too difficult if I were you. It's definitely worth learning (and it helps your resume; it's in high demand). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handle Hibernate transaction in wicket
Actually, Spring lets you (more importantly them) not worry about the transaction stuff at all. The person (you, perhaps) who is wiring things together can add in the transaction stuff in the XML file. On 2/20/08, Sébastien Piller [EMAIL PROTECTED] wrote: Yes, I read a bit about Spring some time ago, but atm I'm working on a project that will be released soon. I can't afford to rewrite half my code on the lasts weeks ;) Next time, I'll take some time to getting started with it. I'm sure it's worth, that's what I read all the day. But I must consider my colleagues, too... They are not very very interested with dev, and already have difficulties to write php... so, with Spring, they will shot themselves :) Thx James Carman a écrit : Once you get used to Spring, you'll really appreciate it. I wouldn't write it off as too difficult if I were you. It's definitely worth learning (and it helps your resume; it's in high demand). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handle Hibernate transaction in wicket
I use onBeginRequest and onEndRequest from the WebRequestCycle, seems to work well. Andy On 13 Feb 2008, at 07:59, Sébastien Piller wrote: Hello, I'm searching for a best practice to integrate some hibernate transaction with Wicket. I'd like to implement the session-per- request that is described here http://www.hibernate.org/hib_docs/v3/reference/fr/html_single/#tutorial-firstapp-workingpersistence I think I can commit the transaction and close the session on the onAfterRender method. But where is the best place to start it? On the first line of the constructor? Or in the onBeforeRender (I think not)? Anywhere else? And what about the ajax queries? I need to recreate a new transaction for each ajax request, need I? Thank you a lot for your think :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Handle Hibernate transaction in wicket
Hello, I'm searching for a best practice to integrate some hibernate transaction with Wicket. I'd like to implement the session-per-request that is described here http://www.hibernate.org/hib_docs/v3/reference/fr/html_single/#tutorial-firstapp-workingpersistence I think I can commit the transaction and close the session on the onAfterRender method. But where is the best place to start it? On the first line of the constructor? Or in the onBeforeRender (I think not)? Anywhere else? And what about the ajax queries? I need to recreate a new transaction for each ajax request, need I? Thank you a lot for your think :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handle Hibernate transaction in wicket
see databinder.net -igor On Feb 12, 2008 11:59 PM, Sébastien Piller [EMAIL PROTECTED] wrote: Hello, I'm searching for a best practice to integrate some hibernate transaction with Wicket. I'd like to implement the session-per-request that is described here http://www.hibernate.org/hib_docs/v3/reference/fr/html_single/#tutorial-firstapp-workingpersistence I think I can commit the transaction and close the session on the onAfterRender method. But where is the best place to start it? On the first line of the constructor? Or in the onBeforeRender (I think not)? Anywhere else? And what about the ajax queries? I need to recreate a new transaction for each ajax request, need I? Thank you a lot for your think :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]