Hi,
first of all thanks for your reply.
Unfortunately is your assumption false: I tried to use a JNDI data source
but I was not able to do it.
I got a NotSerializableException when trying to register a Database Object
or a UnmarshalException when trying
to register a JDO Object. Of course I'm making some coding mistake, my only
excuse is that I don't have any clear example
of how to do it...

(In an example I saw that I had to register the database object, something
like:
context = getInitialContext();
context.rebind(JNDI_DATABASE_NAME, jdo.getDatabase());
... but as I just wrote, it does not work)

So, what I'm trying jet is to use a "JDOFactory", a simple java class, wich
implements the singleton pattern,
and load the database

    private JDOFactory() {
     try {
         JDO jdo = new JDO();
         jdo.loadConfiguration(DATABASE_FILE);
         jdo.setDatabaseName(DATABASE_NAME);
         db = jdo.getDatabase();
     } catch (Exception e) {
         System.out.println(e);
     }
    }

so all the Session Beans can ask for this database calling the method:

Database db = JDOFactory.getInstance().getDatabase();

The code in the stateful session bean looks like this:

     // Get user transaction
     UserTransaction ut = sessionContext.getUserTransaction();
     ...
     ut.begin();
     ...
     // Call business services (stateless SB)
     customerTransaction.execute();


The code in the stateless session beans looks like:

     db = JDOFactory.getInstance().getDatabase();

     CustomerJDO customer = new CustomerJDO(12345, "Customer name");
     db.create(customer);

At this point, as I told you I get the error message:
org.exolab.castor.jdo.TransactionNotInProgressException:
No transaction in progress for the current thread: No transaction in
progress for the current thread

The Stateful SB configuration looks like:

   <session>
      <ejb-name>TransactionStateful</ejb-name>
      <home>transaction.TransactionStatefulHome</home>
      <remote>transaction.TransactionStateful</remote>
      <ejb-class>transaction.TransactionStatefulBean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Bean</transaction-type>
    </session>

I hope these pieces of information can help you to help me...

Thanks a lot for your support.
Have a nice day
Patrick




                                                                                       
                            
                    Sudhir                                                             
                            
                    Bhojwani             To:     [EMAIL PROTECTED]                 
                            
                    <sbhojwani@al        cc:                                           
                            
                    toweb.com>           Subject:     Re: [castor-dev] Bean Managed 
Transactions                   
                                                                                       
                            
                    13.11.2001                                                         
                            
                    03:10                                                              
                            
                    Please                                                             
                            
                    respond to                                                         
                            
                    castor-dev                                                         
                            
                                                                                       
                            
                                                                                       
                            




Hi,

I assume that you are using JNDI data source in the database.xml file. Also
can you please tell me the transaction attribute on the Stateful session
bean
method. Because Weblogic had some issues with transaction context
propogation.

Cheers,
sudhir

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 7:15 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Bean Managed Transactions


Hello,

I'm trying Castor in the following J2EE environment:
- the client applications call a stateful session bean (with Bean managed
transactions), which begins the UserTransaction
- then this SB calls methods of other stateless session beans
- these session beans interact with Castor objects, I mean they call
methods like db.create(...) or call set methods on "jdo" objects

What I would like to see is if it works to manage (begin, commit, rollback)
transactions only from the stateful session bean so that all the others
beans partecipates in these transactions.

The problem I'm experiencing is that, although I've begun the
UserTransaction in the stateful session, when I call for example a
db.create(...) in a stateless session bean I recieve an
"org.exolab.castor.jdo.TransactionNotInProgressException: No transaction in
progress for the current thread".

For your information the used Application server is BEA WebLogic 6.1.

Can somebody help me?

Many thanks.
Patrick Herber

-----------------------------------------------------------
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

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

Reply via email to