> > SS> other hand, castor permits the use of other SAX parser by placing a
> > SS> castor.properties in the classpath (another conf file in the conf
> > SS> directory...) and changing one of it values.
> > I hope Castor is able to use Sun's parser. Haven't tried though.
>
> I tried it, seems not ot be a problem for reding database.xml and mapping
> file, but the XML part of castor won;t be working out of the box.
> Again i can submit the diff for jboss to make use of JAXP, since it's the
> way to go IMHO.

If you can submit a diff that would be great we are a bit "under water"

marc

>
> > SS> HOW TO USE IT :
> > I'll provide the diff of usage instructions.
>
> > SS> * Put the castor jar in lib/ext directory (available from
> > SS> http://castor.exolab.org)
>
> > SS> * Add the Mlet in jboss.conf
>
> > SS> <MLET CODE = "org.jboss.jdbc.CastorDataSourceLoader"
> > SS> ARCHIVE="jboss.jar,castor-0.8.8.jar" CODEBASE="../lib/ext/">
> > SS>    <ARG TYPE="java.lang.String" VALUE="database.xml">
> > SS>    <ARG TYPE="java.lang.String" VALUE="test">
> > SS> </MLET>
>
> > SS> where database.xml is the database document needed by the
> Castor JDO.
> See
> > SS> castor documentation for further info on the content of this file)
> > SS> and the second parameter is the name given to the database
> (atribute of
> > SS> database.xml). It will serve to set the JNDI name. See below.
> > No differences, but in my variant database.xml and mapping.xml should
> > be in the conf directory rather that in bean jar file.
>
> So they are for me too. No problem on this point.
>
>
> > SS> * Declare the resource managers in your  jboss.xml besides your
> > SS> ejb-jar.xml :
> > SS> <jboss>
> > SS>         <resource-manager>
> > SS>                 <res-name>jdo/myjdo</res-name>
> > SS>                 <res-jndi-name>jdo.test</res-jndi-name>
> > SS>         </resource-manager>
> > SS>         [...]
> > SS> </jboss>
> > -                 <res-jndi-name>jdo.test</res-jndi-name>
> > +                 <res-jndi-name>test</res-jndi-name>
>
> > SS> Notice that the jndi name is composed of the second
> parameter of the
> Mlet
> > SS> (jdo.$DBNAME)
> > Why do you add "jdo."? Let user decide how to distinguish different
> > types of resources. The JNDI name shouldn't be bounded to
> > the logical database name for Castor.
> > I propose to make the latter an Mlet parameter.
>
> Well suppose you overrride a JNDI name by inadvertence. It acts like a
> namespace, just like  XADataSourceBean bind XADataSource : 'XA.$NAME'
>
> > SS> * Declare the resource manager JNDI ENC for the beans in
> ejb-jar.xml :
>
> > SS> <session>
> > SS>         [...]
> > SS>         <resource-ref>
> > SS>                 <description>JDO</description>
> > SS>                 <res-ref-name>jdo/myjdo</res-ref-name>
> > SS>                 <res-type>org.exolab.castor.jdo.JDO</res-type>
> > SS>                 <res-auth>Container</res-auth>
> > SS>         </resource-ref>
> > SS> </session>
>
> > SS> * Get the JDO object in your Session bean as :
>
> > SS> a_method () {
> > SS>         InitialContext ic = new InitialContext();
> > SS>         JDO jdo = (JDO) ic.lookup("java:comp/env/jdo/myjdo");
> > SS>         Database db = jdo.getDatabase();
> > SS>         db.create (obj1);
> > SS>         [...]
> > SS>         db.remove(obj2)
> > SS>         [...]
> > SS>         whatever action on db
> > SS> }
> > All the same.
>
> Well perfect !
>
> Sebastien
>
>
> > Best regards,
> >  Oleg
>
>


Reply via email to