geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: getting the datasource ref in a gbean
Date Mon, 06 Mar 2006 16:54:00 GMT

On Mar 6, 2006, at 8:22 AM, Manu George wrote:

> Hi,
>       I have a geronimo-web.xml with a gbean defined inside. I am  
> starting a service with the gbean which starts a service that tries  
> to get a datasource from the InitialContext.  I have given the  
> resource-ref in geronimo-web.xml It seems that the gbean is  
> starting first before the datasource is populated in the  
> InitialContext. Is there any property that i can set so as to delay  
> starting of the Gbean until after the resource references are  
> registered in the JNDIContext ?

The jndi context is only available from j2ee components (or  
components that are called from j2ee components, on the same  
thread).  I think you want a gbean reference to the  
ManagedConnectionFactoryWrapper and to call $getResource on it.  For  
an example of how to do this, see  
JDBCStoreThreadPooledNonTransactionalTimer.

If I've misunderstood what you are trying to do and you really just  
need to sequence the gbean startup order, you can use a gbean  
dependency, which looks like a reference but without the name attribute.

thanks
david jencks
>
> Thanks
> Manu


Mime
View raw message