-
1. Re: Using default datasource in standardjbosscmp-jdbc.xml
jbrosenberg May 29, 2003 4:09 AM (in response to jbrosenberg)Sorry, there's a typo....
I did define the default
ds to be:
java:/OracleDS
(Not OraclePool as I typed there)....
Jason -
2. Re: Using default datasource in standardjbosscmp-jdbc.xml
jonmartin Jun 3, 2003 7:58 AM (in response to jbrosenberg)What happens in the jboss console window (or logs) when you (re)deploy your oracle-ds.xml? Do you get exceptions or happygolucky-messages?
Are you sure your jbosscmp-jdbc.xml is actually seen by jboss? Sounds like it's being ignored. Try to make it unparsable, and redeploy, just to check if jboss actually tries to read it. -
3. Re: Using default datasource in standardjbosscmp-jdbc.xml
jonmartin Jun 3, 2003 8:23 AM (in response to jbrosenberg)Uh, sorry, I didn't notice you altered the standardjboss-cmp-file instead of telling jboss which datasource to use in jbosscmp-jdbc.xml.
Here is what I would do:
1. restore the original hypersonic-ds.xml and the original standardjbosscmp-jdbc.xml, just to make sure there are no typo's lurking around. (By default JMS uses DefaultDS for message queues it seems, and it might or might not work well with Oracle and defaults. Anyway, this shouldn't affect your entitybeans. However you should have seen a lot of complaints from jboss when the DefaultDS was gone when you removed hypersonic-ds.xml ... )
2. (re)deploy oracle-ds.xml and carefully watch your logs to see if OracleDS is actually registered, or if you get any exceptions. Does it find the driver classes? Did you put the driver jar in .../server/default/lib where it'll be read (you must restart jboss otherwise it won't find it, I think ...)
3. in order to make your entity-beans use OracleDS instead of DefaultDS you must add something to your jbosscmp-jdbc.xml that you include in your ejb jar file.
I just used the standardjbosscmp-jdbc.xml as a template and ripped out basically everything except the -section. I also kept the relevant type-mapping to tinker with, but I suppose you don't need that.
This leaves me with DefaultDS on hypersoniq that at least keep JMS - and what do I know else - happy, and MyVeryOwnDS that is defined in my myveryown-ds.xml and ofcourse ejb-specific instructions on which datasource to use.
Here is the top of my jbosscmp-jdbc.xml (which goes in meta-inf, ofcourse)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc>
<!-- ===================================================================== -->
<!-- -->
<!-- Standard JBossCMP-JDBC Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- $Id: standardjbosscmp-jdbc.xml,v 1.23.2.25 2003/01/27 22:29:13 binaryfeed Exp $ -->
<jbosscmp-jdbc>
java:/AprosjektDS
<datasource-mapping>mySQL</datasource-mapping>
<create-table>true</create-table>
<remove-table>false</remove-table>
<read-only>false</read-only>
<time-out>300</time-out>
<pk-constraint>true</pk-constraint>
<fk-constraint>false</fk-constraint>
<row-locking>false</row-locking>
<preferred-relation-mapping>foreign-key</preferred-relation-mapping>
<read-ahead>
on-load
<page-size>1000</page-size>
<eager-load-group>*</eager-load-group>
</read-ahead>
<list-cache-max>1000</list-cache-max>
<type-mappings>
<type-mapping>
mySQL
<row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 FOR UPDATE</row-locking-template>
<pk-constraint-template>CONST
.......
Using jboss 3.0.X I used to get it running using your approach altering standardjbosscmp-jdbc, but on 3.2.1 I got so many errors messing with DefaultDS that I decided to set up application specific DS'es and leave the default alone, which is ofcourse the best thing to do, but I only had one app running and was to lazy ... :-)