tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Baylis <mich...@baylishome.me.uk>
Subject Re: JUnit embedded OPENEJB and XAResource problems
Date Fri, 06 Jan 2012 16:07:53 GMT
Andy,
        As far as I know:-

         Properties p = new Properties();
         p.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.apache.openejb.client.LocalInitialContextFactory");

         p.put("HomeAccountsDB", "new://Resource?type=DataSource");
         p.put("HomeAccountsDB.JdbcDriver", 
"org.apache.derby.jdbc.EmbeddedDriver");
         p.put("HomeAccountsDB.JdbcUrl", "jdbc:derby:firstdb;create=true");
         p.put("HomeAccountsDB.JtaManaged", "true");

         p.put("HomeAccountsDBUnmanaged", "new://Resource?type=DataSource");
         p.put("HomeAccountsDBUnmanaged.JdbcDriver", 
"org.apache.derby.jdbc.EmbeddedDriver");
         p.put("HomeAccountsDBUnmanaged.JdbcUrl", 
"jdbc:derby:firstdb;create=true");
         p.put("HomeAccountsDBUnmanaged.JtaManaged", "false");

         Context context = new InitialContext(p);

         TestEJBLocal te = (TestEJBLocal) context.lookup("TestEJBLocal");

         String x = te.getTestString();


Michael

On 01/06/2012 03:01 PM, AndyG wrote:
> Are you sure you have your DataSource configured properly?
>
> http://openejb.apache.org/configuring-datasources-in-tests.html
>
> ...
>
> p.put("myDataSource.JtaManaged", "true");
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/JUnit-embedded-OPENEJB-and-XAResource-problems-tp4269488p4269649.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message