Datasources registration in JNDI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Datasources registration in JNDI

alaley
Hello to all,

as I can understand in the case of using
bitronix.tm.jndi.BitronixInitialContextFactory as JNDI provider,
BTM will register TransactionManager and configured datasources
in its InitialContext.

But what if third-party JNDI prvider will be used?
Is it an app developer responsibility to register TransactionManager and
datasources in JNDI?

Thanks,
Serge.


PS
Why "bitronix.tm.resource.bind" option was removed?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Datasources registration in JNDI

Ludovic Orban
Administrator
Hi,

The bitronix.tm.jndi.BitronixInitialContextFactory is mostly meant to be used for plain J2SE applications running outside an application server. When running inside an application server you should bind the BTM objects yourself to the application server's JNDI in some vendor define way. This is of course specific to the application server. Another solution is to avoid using JNDI when that makes sense, for instance when using Spring.

The bitronix.tm.resource.bind parameter was removed because it wasn't that useful and encouraged bad practices: the resources were bound by their JNDI name which could not be ENC names (ie: starting with java:comp) which involved non-standard mechanism to retrieve bound resources. It's only sensible use was for outside of application server usage but the BitronixInitialContextFactory does a better job here.

Ludovic
Reply | Threaded
Open this post in threaded view
|

Re: Datasources registration in JNDI

alaley
Ludovic Orban пишет:
> Hi,
>
> The bitronix.tm.jndi.BitronixInitialContextFactory is mostly meant to be
> used for plain J2SE applications running outside an application server. When
> running inside an application server you should bind the BTM objects
> yourself to the application server's JNDI in some vendor define way. This is
> of course specific to the application server. Another solution is to avoid
> using JNDI when that makes sense, for instance when using Spring.
>
...(after looking into
org/springframework/orm/jpa/persistenceunit/MutablePersistenceUnitInfo.java)
Spring is more flexible than I thought ;-)

thanks,
Serge.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email