Hello Aaron,
Dohh - After review of RefContext.getConnectionFactoryContainerId I
confirm that I was definitively wrong. Sorry for having provided such a
wrong response and I hope that I did not confuse too many users :(
Gianny
Aaron Mulder wrote:
Gianny -- I don't believe your resource-link information is correct.
A resource-link should work for either a resource (in this case, DB
pool) deployed in the same EAR, *or* in the top level of the server
(e.g. as a standalone database connection pool). Do you disagree?
(My understanding from David J is that ejb-link, in contrast, works
the way you describe, so the two are not similar in that respect.)
Thanks,
Aaron
On 3/18/06, Gianny Damour <[EMAIL PROTECTED]> wrote:
Olivier Voutat wrote:
Well,
I'm trying to create a simple application with a Cmp Entity Bean but
I'm missing how I should do the Database connection tags. My database
pool is already deployed and working. Here are my ejb-jar.xml and
openejb-jar.xml :
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="ejb-jar_ID" version="2.1"
xmlns="http://java.sun.com/xml/ns/j2ee
<http://java.sun.com/xml/ns/j2ee>"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
<http://java.sun.com/xml/ns/j2ee>
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>ProdutoCmp</display-name>
<enterprise-beans>
<...>
<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns=" http://www.openejb.org/xml/ns/openejb-jar-2.0"
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0" xmlns:pkgen="
http://www.openejb.org/xml/ns/pkgen-2.0"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="
http://geronimo.apache.org/xml/ns/deployment-1.0"
configId="ProdutoCmp/ProdutoCmp">
<cmp-connection-factory>
<resource-link>ProdutoCmp</resource-link>
</cmp-connection-factory>
If the database pool is already deployed, i.e. not deployed at the same
time than your EJB module within an EAR, then you cannot use the
resource-link tag. This tag allows you to point to a
connectiondefinition-instance defined in the same EAR module than your
EJB moduler (this is more or less like the ejb-link mechanism).
In your case, you need to use a
http://geronimo.apache.org/xml/ns/naming-1.0:objectNameGroup (have a
look to geronimo-naming-1.0.xsd for more details). I think that you want
something like this:
<cmp-connection-factory>
<application><the name of the EAR module defining the RAR - null
if the RAR was deployed as a standalone module></application>
<module><name of the RAR module></module>
<name><name of the connectiondefinition-instance>.</name>
</cmp-connection-factory>
Thanks,
Gianny