I actually do the following (which works):

JDO _jdo = new JDO();
... set up _jdo
_jdo.setTransactionManager("weblogic.transaction.TransactionManager" );
new javax.naming.InitialContext().rebind( JDO_BIND_NAME, _jdo );  // No
reference.....



Then access as:

Object ref = new InitialContext().lookup( JDO_BIND_NAME );
JDO _jdo = (JDO)PortableRemoteObject.narrow( JDO.class, ref );
Database = _jdo.getDatabase();
...

But have also done:
JDO _jdo = (JDO)new InitialContext().lookup( JDO_BIND_NAME );



-----Original Message-----
From: Markus Fritz [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 5:34 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] weblogic integration / JNDI


Hi,

i have tries to integrate castor in our weblogic 6.1 env and it
seems to work but i wonder if it was correct that way.

The castor docu is not very clear on J2EE integration; in weblogic
docu i cannot find anything how to get castor registered in JNDI 
globally - i don't want to do it in each EJB DD.

so i wrote that code (within our StartupTask):

      org.exolab.castor.jdo.JDO oJDO =
            new org.exolab.castor.jdo.JDO( DATABASE_NAME );

      .... setup JDO ...

     oJDO.setTransactionManager(
"weblogic.transaction.TransactionManager" );

     javax.naming.InitialContext ictx = new
javax.naming.InitialContext();
     ictx.rebind( MY_CASTOR_DATABASE_NAME, oJDO.getReference() );

to access / get an Dtabase i use:

     org.exolab.castor.jdo.JDO jdo = (org.exolab.castor.jdo.JDO)
            getInitialContext().lookup( CASTOR_DATABASE_NAME );
     db = jdo.getDatabase();
 
can anyone confirm that this way is OK ?

thanks in advance,

   Markus Fritz

-- 
Dipl.-Ing. (FH) Markus Fritz                 [EMAIL PROTECTED]
Just Innovative Software GmbH * Heimsheimerstr. 1 * 70499 Stuttgart

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to