Jeffrey,

That won't prevent a connection from being released. The LDM holds a
reference to the page, and the page has a serializable proxy to the service
implementation. No problem there. Injecting the service into the LDM is
only an advantage if you want to share it among pages; then the LDM can be
static and its page reference goes away.

It sounds like your service implementation may have an issue. Does your
service manage its own connections? If so, is it a singleton? Other than
that, I'd guess there's a bug in your transaction management such that a
transaction gets started but not finished.

HTH,
Dan

On Wed, Mar 21, 2012 at 1:45 PM, Jeffrey Schneller <
jeffrey.schnel...@envisa.com> wrote:

> Is this the correct construction of a LDM where I need to use a service
> bean to access my database?  The IMyService bean  is injected on the page
> and passed to the LDM.  Does this make the LDM hold a reference to the
> IMyService bean and possibly keep a connection from being put back into the
> c3p0 db connection pool?  After some period of time my application is
> blocked with all threads waiting on a connection to the db.
>
> Should I be injected the IMyService bean into the LDM using the commented
> out code.  Thanks for any help.
>
> public class MyLDM extends LoadableDetachableModel<com.example.MyObject> {
>
>                //@SpringBean
>                private IMyService service;
>
>                private String id;
>
>                public MyLDM(String id, IMyService service)       {
>                                this.id = id;
>                                this.service = service;
>                }
>
>
>                //public MyLDM(String id)           {
>                //            this.id = id;
>                //}
>
>
>                @Override
>                protected com.example.MyObject load() {
> //InjectorHolder.getInjector().inject(this);
>                                return service.getMyObject(this.id);
>                }
> }
>

Reply via email to