You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Makundi <ma...@koodaripalvelut.com> on 2008/08/03 12:45:31 UTC

Managing database connection?

Hi!

What is the best place to open/close a data connection in Wicket?

I prefer lazy open, but where is the best place to perform the
connection/entitymanager.close? Override servlet request? Filter?

**
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Managing database connection?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> how is a custom request cycle heavy weight? It isn't–it's a common practise.

Ok :) I just had a look at DataBinder.net, that was more heavy-weght.

Is there any short introduction available on how to implement
onEndRequest() -hook, or is the best reference to just have a look at
the respective code of DataBinder.net?

**
Martin
>
> On Sun, Aug 3, 2008 at 2:28 PM, Martin Makundi
> <ma...@koodaripalvelut.com> wrote:
>> Anything lighter? Basically I just need to hook the onEndRequest()
>> event. I assume it would be bad practice to extend the wicket servlet,
>> though ..
>>
>> **
>> Martin
>>
>> 2008/8/3 Martijn Dashorst <ma...@gmail.com>:
>>> Create a custom request cycle that opens a Session in onBeginRequest
>>> and closes it in onEndRequest. Perhaps DataBinder.net has one readily
>>> available.
>>>
>>> Martijn
>>>
>>> On Sun, Aug 3, 2008 at 1:11 PM, Martin Makundi
>>> <ma...@koodaripalvelut.com> wrote:
>>>> I am using Hibernate/JPA without Spring. Is there a suitable
>>>> interceptor class in Wicket that could be used?
>>>>
>>>> **
>>>> Martin
>>>>
>>>> 2008/8/3 Martijn Dashorst <ma...@gmail.com>:
>>>>> Most folks use open session in view filter from Spring (in combination
>>>>> with Hibernate). I think they have a similar filter for JDBC template
>>>>> (which is highly recommended for normal JDBC actions IMO).
>>>>>
>>>>> Martijn
>>>>>
>>>>> On Sun, Aug 3, 2008 at 12:45 PM, Martin Makundi
>>>>> <ma...@koodaripalvelut.com> wrote:
>>>>>> Hi!
>>>>>>
>>>>>> What is the best place to open/close a data connection in Wicket?
>>>>>>
>>>>>> I prefer lazy open, but where is the best place to perform the
>>>>>> connection/entitymanager.close? Override servlet request? Filter?
>>>>>>
>>>>>> **
>>>>>> Martin
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>>>>> Apache Wicket 1.3.4 is released
>>>>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>>> Apache Wicket 1.3.4 is released
>>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Managing database connection?

Posted by Martijn Dashorst <ma...@gmail.com>.
how is a custom request cycle heavy weight? It isn't–it's a common practise.

Martijn

On Sun, Aug 3, 2008 at 2:28 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
> Anything lighter? Basically I just need to hook the onEndRequest()
> event. I assume it would be bad practice to extend the wicket servlet,
> though ..
>
> **
> Martin
>
> 2008/8/3 Martijn Dashorst <ma...@gmail.com>:
>> Create a custom request cycle that opens a Session in onBeginRequest
>> and closes it in onEndRequest. Perhaps DataBinder.net has one readily
>> available.
>>
>> Martijn
>>
>> On Sun, Aug 3, 2008 at 1:11 PM, Martin Makundi
>> <ma...@koodaripalvelut.com> wrote:
>>> I am using Hibernate/JPA without Spring. Is there a suitable
>>> interceptor class in Wicket that could be used?
>>>
>>> **
>>> Martin
>>>
>>> 2008/8/3 Martijn Dashorst <ma...@gmail.com>:
>>>> Most folks use open session in view filter from Spring (in combination
>>>> with Hibernate). I think they have a similar filter for JDBC template
>>>> (which is highly recommended for normal JDBC actions IMO).
>>>>
>>>> Martijn
>>>>
>>>> On Sun, Aug 3, 2008 at 12:45 PM, Martin Makundi
>>>> <ma...@koodaripalvelut.com> wrote:
>>>>> Hi!
>>>>>
>>>>> What is the best place to open/close a data connection in Wicket?
>>>>>
>>>>> I prefer lazy open, but where is the best place to perform the
>>>>> connection/entitymanager.close? Override servlet request? Filter?
>>>>>
>>>>> **
>>>>> Martin
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>>>> Apache Wicket 1.3.4 is released
>>>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>> Apache Wicket 1.3.4 is released
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Managing database connection?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Anything lighter? Basically I just need to hook the onEndRequest()
event. I assume it would be bad practice to extend the wicket servlet,
though ..

**
Martin

2008/8/3 Martijn Dashorst <ma...@gmail.com>:
> Create a custom request cycle that opens a Session in onBeginRequest
> and closes it in onEndRequest. Perhaps DataBinder.net has one readily
> available.
>
> Martijn
>
> On Sun, Aug 3, 2008 at 1:11 PM, Martin Makundi
> <ma...@koodaripalvelut.com> wrote:
>> I am using Hibernate/JPA without Spring. Is there a suitable
>> interceptor class in Wicket that could be used?
>>
>> **
>> Martin
>>
>> 2008/8/3 Martijn Dashorst <ma...@gmail.com>:
>>> Most folks use open session in view filter from Spring (in combination
>>> with Hibernate). I think they have a similar filter for JDBC template
>>> (which is highly recommended for normal JDBC actions IMO).
>>>
>>> Martijn
>>>
>>> On Sun, Aug 3, 2008 at 12:45 PM, Martin Makundi
>>> <ma...@koodaripalvelut.com> wrote:
>>>> Hi!
>>>>
>>>> What is the best place to open/close a data connection in Wicket?
>>>>
>>>> I prefer lazy open, but where is the best place to perform the
>>>> connection/entitymanager.close? Override servlet request? Filter?
>>>>
>>>> **
>>>> Martin
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>>> Apache Wicket 1.3.4 is released
>>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Managing database connection?

Posted by Martijn Dashorst <ma...@gmail.com>.
Create a custom request cycle that opens a Session in onBeginRequest
and closes it in onEndRequest. Perhaps DataBinder.net has one readily
available.

Martijn

On Sun, Aug 3, 2008 at 1:11 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
> I am using Hibernate/JPA without Spring. Is there a suitable
> interceptor class in Wicket that could be used?
>
> **
> Martin
>
> 2008/8/3 Martijn Dashorst <ma...@gmail.com>:
>> Most folks use open session in view filter from Spring (in combination
>> with Hibernate). I think they have a similar filter for JDBC template
>> (which is highly recommended for normal JDBC actions IMO).
>>
>> Martijn
>>
>> On Sun, Aug 3, 2008 at 12:45 PM, Martin Makundi
>> <ma...@koodaripalvelut.com> wrote:
>>> Hi!
>>>
>>> What is the best place to open/close a data connection in Wicket?
>>>
>>> I prefer lazy open, but where is the best place to perform the
>>> connection/entitymanager.close? Override servlet request? Filter?
>>>
>>> **
>>> Martin
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>> Apache Wicket 1.3.4 is released
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Managing database connection?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
I am using Hibernate/JPA without Spring. Is there a suitable
interceptor class in Wicket that could be used?

**
Martin

2008/8/3 Martijn Dashorst <ma...@gmail.com>:
> Most folks use open session in view filter from Spring (in combination
> with Hibernate). I think they have a similar filter for JDBC template
> (which is highly recommended for normal JDBC actions IMO).
>
> Martijn
>
> On Sun, Aug 3, 2008 at 12:45 PM, Martin Makundi
> <ma...@koodaripalvelut.com> wrote:
>> Hi!
>>
>> What is the best place to open/close a data connection in Wicket?
>>
>> I prefer lazy open, but where is the best place to perform the
>> connection/entitymanager.close? Override servlet request? Filter?
>>
>> **
>> Martin
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Managing database connection?

Posted by Martijn Dashorst <ma...@gmail.com>.
Most folks use open session in view filter from Spring (in combination
with Hibernate). I think they have a similar filter for JDBC template
(which is highly recommended for normal JDBC actions IMO).

Martijn

On Sun, Aug 3, 2008 at 12:45 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
> Hi!
>
> What is the best place to open/close a data connection in Wicket?
>
> I prefer lazy open, but where is the best place to perform the
> connection/entitymanager.close? Override servlet request? Filter?
>
> **
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org