TomEE: How to configure multiple datasources?

727 views Asked by At

I have configured single data source in tomee.xml

<Resource id="myDataSource" type="javax.sql.DataSource">
   accessToUnderlyingConnectionAllowed = false
   initialSize = 0
   jdbcDriver = org.hsqldb.jdbcDriver
   jdbcUrl = jdbc:hsqldb:mem:hsqldb
   jtaManaged = true
   maxActive = 20
   maxIdle = 20
   password = password
   userName = admin
</Resource>

and it is working without any issues.

but now i want to configure one more data source so

  1. Can we directly add one more resource?
  2. Do we need to do any additional configuration for more than one datasources?
  3. If it is multiple data sources then how to assign priority?
1

There are 1 answers

0
barun On BEST ANSWER
  1. Can we directly add one more resource?

    • Yes you can
  2. Do we need to do any additional configuration for more than one datasources?

    • Yes
  3. If it is multiple data sources then how to assign priority?