Skip to Content
0
Aug 05, 2005 at 10:28 AM

Open SQL/JDBC

99 Views

Hi All,

I am trying to learn OpenSQL/JBDBC. I have followed the example given in help.sap.com under Getting Started Relational Persistance.

1. I created a table in Dictionary perspective and deployed it.

2. Then i created an EJB in which i have created an interface named DAO wherein i have a select and an update method.i have also implemented this interface.

In the constructor of the implementing class i lookup the datasource(using an alias) and get a connection. I set the autocommit to false.

3. Then i tested the ejb by calling it from a standalone application. and it works fine.

4. However when i call the ejb from another ejb i am getting an exception which is

<b><i>"Cannot initiate transaction from a connection of "SAP<SID>DB" DataSource. Local or distributed transaction has already started."</i></b>

This ejb is being called called by another program which i suppose has already started the transaction and in the constructor when i try to start the new transaction it gives me this exception.

Please do let me know how to overcome this.

Regards

Sidharth