I'm afraid I'm still a bit too wiped out from a bad cold to look into
this in great detail but one easy problem you might have is that in
order for your ear to find the datasource the datasource has to be
defined in one of the ancestors ((transitive) dependencies) of the
ear. In other words the ear plan should have your console.dbpool/OES/
1.0/rar listed as a dependency in the environment section.
I haven't figured out how the rest of what you have shown fits
together, in particular I don't understand the NPE from tranql.
I would suggest using the postgres-specific tranql connector. I'm
sure it got published and think it's included in geronimo 2.0.2....
certainly in 2.1-SNAPSHOT.
hope this helps
david jencks
On Dec 30, 2007, at 6:39 AM, Garth Keesler wrote:
Garth Keesler wrote:
I think that this comes down to the right way to associate a
persistence context with a gmo dbpool database (other than Derby).
It's probably very simple but I've not found the right combo to
make it work. Still trying...
Pointers welcome.
Thx,
Garth
.
Sorry to keep replying to myself...
Here are the two files in the Bank app that I think are causing the
probs.
First is the BankPool.xml file and, in particular, I think the
<resourceadapter> section has a problem with the <name>. I've tried
a variety of different names but am not sure if it should be the
same as the dbpool name or not.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/
connector-1.2">
<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/
deployment-1.2">
<dep:moduleId>
<dep:groupId>console.dbpool</dep:groupId>
<dep:artifactId>OES</dep:artifactId>
<dep:version>1.0</dep:version>
<dep:type>rar</dep:type>
</dep:moduleId>
<dep:dependencies>
<dep:dependency>
<dep:groupId>postgresql</dep:groupId>
<dep:artifactId>postgresql-8.1</dep:artifactId>
<dep:version>404.jdbc3</dep:version>
<dep:type>jar</dep:type>
</dep:dependency>
</dep:dependencies>
</dep:environment>
<resourceadapter>
<outbound-resourceadapter>
<connection-definition>
<connectionfactory-interface>javax.sql.DataSource</
connectionfactory-interface>
<connectiondefinition-instance>
<name>console.dbpool/OES</name>
<connectionmanager>
<local-transaction/>
<single-pool>
<max-size>10</max-size>
<min-size>0</min-size>
<match-one/>
</single-pool>
</connectionmanager>
</connectiondefinition-instance>
</connection-definition>
</outbound-resourceadapter>
</resourceadapter>
</connector>
Second is the persistence.xml file. I'm not sure what the <jta-data-
source> name should be. I've tried using "OES", "console.dbpool/
OES", and several others but none seem to work. The <non-jta-data-
source> has been commented out to simplify.
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://
java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="BankPU">
<description>Entity Beans for Bank</description>
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</
provider>
<class>org.apache.geronimo.samples.bank.ejb.Account</class>
<class>org.apache.geronimo.samples.bank.ejb.Customer</class>
<class>org.apache.geronimo.samples.bank.ejb.ExchangeRate</class>
<properties>
<property name="openjpa.jdbc.SynchronizeMappings" value="false" />
<property name="openjpa.jdbc.DBDictionary" value="postgres"/>
</properties>
<jta-data-source>console.dbpool/OES</jta-data-source>
<!--
<non-jta-data-source>OESDataSource</non-jta-data-source>
-->
</persistence-unit>
</persistence>
I've googled for suggestions but have not found anything of value
so far.
Thx,
Garth