tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject [tomee] 02/04: Correct the config so the Derby database is picked up
Date Fri, 14 Jun 2019 15:44:24 GMT
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 79c51174f2de0fb86534dcd3674dd077b23375ad
Author: Jonathan Gallimore <jon@jrg.me.uk>
AuthorDate: Fri Jun 14 16:35:12 2019 +0100

    Correct the config so the Derby database is picked up
---
 .../src/main/java/org/superbiz/injection/jpa/MoviesXA.java        | 4 ++++
 .../src/test/java/org/superbiz/injection/jpa/MoviesXATest.java    | 8 +++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/examples/xa-datasource/src/main/java/org/superbiz/injection/jpa/MoviesXA.java
b/examples/xa-datasource/src/main/java/org/superbiz/injection/jpa/MoviesXA.java
index 05a384d..7c2be21 100644
--- a/examples/xa-datasource/src/main/java/org/superbiz/injection/jpa/MoviesXA.java
+++ b/examples/xa-datasource/src/main/java/org/superbiz/injection/jpa/MoviesXA.java
@@ -21,6 +21,7 @@ import javax.annotation.Resource;
 import javax.ejb.Singleton;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+import javax.sql.DataSource;
 import javax.transaction.RollbackException;
 import javax.transaction.SystemException;
 import javax.transaction.TransactionManager;
@@ -39,6 +40,9 @@ public class MoviesXA {
     @PersistenceContext
     private EntityManager em;
 
+    @Resource(name = "movieDatabase")
+    private DataSource ds;
+
     @Resource
     private TransactionManager transactionManager;
 
diff --git a/examples/xa-datasource/src/test/java/org/superbiz/injection/jpa/MoviesXATest.java
b/examples/xa-datasource/src/test/java/org/superbiz/injection/jpa/MoviesXATest.java
index 56ee0c6..afad529 100644
--- a/examples/xa-datasource/src/test/java/org/superbiz/injection/jpa/MoviesXATest.java
+++ b/examples/xa-datasource/src/test/java/org/superbiz/injection/jpa/MoviesXATest.java
@@ -60,12 +60,8 @@ public class MoviesXATest {
 
         final Properties p = new Properties();
 
-        p.put("movieDatabaseXA", "new://Resource?type=javax.sql.XADataSource&class-name=org.apache.derby.jdbc.EmbeddedXADataSource");
-        p.put("movieDatabaseXA.DatabaseName", db);
-        p.put("movieDatabaseXA.CreateDatabase", "create");
-
         p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.XaDataSource", "movieDatabaseXA");
+        p.put("movieDatabase.JdbcDriver", "org.apache.derby.jdbc.EmbeddedXADataSource");
         p.put("movieDatabase.JtaManaged", "true");
         p.put("movieDatabase.UserName", "admin");
         p.put("movieDatabase.Password", "admin");
@@ -81,6 +77,8 @@ public class MoviesXATest {
         p.put("movieDatabase.PoolPreparedStatements", "true");
         p.put("movieDatabase.MaxOpenPreparedStatements", "1024");
         p.put("movieDatabase.ValidationQuery", "values 1");
+        p.put("movieDatabase.DatabaseName", db);
+        p.put("movieDatabase.CreateDatabase", "create");
 
         p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
         p.put("movieDatabaseUnmanaged.LogSql", "true");


Mime
View raw message