More progress and another brick wall. After spending too many hours
researching connection pools, it looks like the problem was actually a lack
of @Transactional on the DAO method used by the EntityModel. Now I've added
@Transactional, but that puts me back to getting the
LazyInitializationException when I access one of PersonInfo's lazily loaded
properties. Ugh...

So now my question goes back to the smart EntityModel approach (as per
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ ). When I
search the mailing list, I see LDM/EntityModel given as the solution for
LazyInitializationException. I don't understand why wrapping the object in a
model should help (and in my case it doesn't help, probably because I'm
implementing it wrong).

As I understand it, the LazyInitializationException is thrown because the
Hibernate session closes after I call EntityDao.load(). But if that's the
problem, then why should an LDM help? Won't the Hibernate session close
again as soon as the LDM's load() is called?

well, regardless, let me echo Nino's tagline and say, "Wicket for love!" As
frustrating as this is, I know it would be ten times more frustrating back
in Struts-land, where I'm from.


Dane



On Tue, Aug 25, 2009 at 3:53 PM, Dane Laverty <danelave...@gmail.com> wrote:

> Good point. Now that I've switched to c3p0, I'm getting more debug info,
> i.e.:
>
> DEBUG - BasicResourcePool - [managed: 3, unused: 1, excluded: 0]
> DEBUG - BasicResourcePool - [managed: 3, unused: 0, excluded: 0]
> DEBUG - BasicResourcePool - [managed: 4, unused: 1, excluded: 0]
> DEBUG - BasicResourcePool - [managed: 4, unused: 0, excluded: 0]
> ...
> DEBUG - BasicResourcePool - [managed: 15, unused: 0, excluded: 0]
> DEBUG - BasicResourcePool - acquire test -- pool is already maxed out.
> [managed: 15; max: 15]
>
> It turns out that the problem has nothing to do with clicking really fast.
> After 15 clicks on any of the links in the app, it will freeze. I'm using
> wicket-auth for security, so the EntityModel<UserInfo> is inflating the
> UserInfo object on every page to check for permissions, and the connections
> are not being released. This was not an issue before I moved my UserInfo
> into the detachable EntityModel. I'll do some more research.
>
> Dane
>
>
>
>
> On Tue, Aug 25, 2009 at 3:34 PM, Edward Zarecor 
> <edw...@indeterminate.org>wrote:
>
>> There's no connection pool size defined.  Is the default pool size for
>> dbcp
>> 1?
>>
>> Ed.
>>
>> On Aug 25, 2009 5:29 PM, "Dane Laverty" <danelave...@gmail.com> wrote:
>>
>> I'm using dbcp, as per below. I'll try switching over to c3p0 and see if
>> that helps.
>>
>>   <bean id="dataSourceOracle"
>> class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>>       <property name="driverClassName" value="${jdbc.oracle.driver}"/>
>>       <property name="url" value="${jdbc.oracle.url}"/>
>>       <property name="username" value="${jdbc.oracle.username}"/>
>>       <property name="password" value="${jdbc.oracle.password}"/>
>>   </bean>
>>
>>
>> On Tue, Aug 25, 2009 at 2:25 PM, Martijn Dashorst <
>>
>> martijn.dasho...@gmail.com> wrote: > Do you use a connection pool? e.g.
>> datasource definition in yo...
>>
>
>

Reply via email to