OF COURSE NOT !
You're absolutely right. Sorry for messing up things, guys.
Since you're handling persistency to the DB in the BMP entity itself, you
have to retrieve a datasource to do so (nothing to do with JAWS), and that's
it.
So the way I do it (if I'm right this time ;o) is that I declare an external
resource reference into my ejb-jar.xml file, like this (it allows me to get
the datasource from the bean by a JNDI lookup) :

<entity>
  ...
  <resource-ref>
    <description>Storage for My Bean</description>
    <res-ref-name>jdbc/MyStorage</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
  ...
</entity>

Then, in the jboss.xml, I map it to the datasource I defined in the
jboss.conf and jboss.jcml (I called the datasource OracleDS) :

  <resource-managers>
    <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
      <res-name>jdbc/OracleStorage</res-name>
      <res-jndi-name>OracleDS</res-jndi-name>
    </resource-manager>
  </resource-managers>

  <enterprise-beans>
    <entity>
      ...
      <resource-ref>
        <res-ref-name>jdbc/MyStorage</res-ref-name>
        <resource-name>jdbc/OracleStorage</resource-name>
      </resource-ref>
      ...
    </entity>
  </enterprise-beans>

That's it...
Hope I got it right this time... ;o)

                        Pascal Davoust.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Tim Yates
Sent: Tuesday, December 05, 2000 12:04 PM
To: jBoss
Subject: Re: [jBoss-User] BMP - How to setup database resource


From: Pascal Davoust <[EMAIL PROTECTED]>

> Hi,
>
> <snip>
>
> You'll need to add a configuration manager specifying to use JAWS as the
> container entity manager (and tell the container to use it for your bean),
> and add a jaws.xml in your archive where you define that JAWS must use the
> datasource you define in jBoss configuration files instead of the Default
> DS.

Do you have to add a jaws.xml file if you are using BMP (as the subject
says)?

Tim.




--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to