Disable auto-create resource TomEE+ 1.5.1

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

Disable auto-create resource TomEE+ 1.5.1

xanko
Hello,

I am looking for how disable the auto-creation of resources in TomEE+ 1.5.1. Indeed, I create a managed datasource with an initial size of pool of 5 connections. My problem is that in addition of my JTA datasource, an unmanaged resource is automatically created... so I have 10 sessions opened on my database. (see the note on resources :http://tomee.apache.org/configuring-datasources-in-tests.html)

Please, how can I disable the auto-create of this unintended datasource ?

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Disable auto-create resource TomEE+ 1.5.1

Romain Manni-Bucau
Hi,

why don't you just define it?

the opposite (prevent jta ds creation from non jta) can be done
using openejb.autocreate.jta-datasource-from-non-jta-one flag but not
preventing non jta creation from jta.

The best practise would be to define the non jta with a size of 0.

you can use tomee.autoconfig=false or openejb.offline=true to be sure no
"not defined" resources are created

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/1/29 xanko <[hidden email]>

> Hello,
>
> I am looking for how disable the auto-creation of resources in TomEE+
> 1.5.1.
> Indeed, I create a managed datasource with an initial size of pool of 5
> connections. My problem is that in addition of my JTA datasource, an
> unmanaged resource is automatically created... so I have 10 sessions opened
> on my database. (see the note on resources
> :http://tomee.apache.org/configuring-datasources-in-tests.html)
>
> Please, how can I disable the auto-create of this unintended datasource ?
>
> Thank you
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Disable-auto-create-resource-TomEE-1-5-1-tp4660448.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Disable auto-create resource TomEE+ 1.5.1

xanko
Hi Romain,

With the parameter "openejb.offline" or when I define a non jta resource with a size of 0, it's perfect !

Before, I tried "tomee.config" but it didn't work and I haven't had the idea to define the unmanaged resource...

Thank you for your help

Xanko