cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC adapter Commit/Rollback

Former Member
0 Kudos

Hi Guys, I got a question regarding JDBC adapter auto commit. Hopefully you guys can help me :). Until now, when my XI calling a storedprocedure in ORACLE using JDBC adapter, it will automatically commit the calling. When i see my configuration for the JDBC adapter receiver, the checkbox for Enable Autocommit is thicked. My question is, is there anyway that we handle the commit or rollback ourself. How we can handle that? Is it from the BPM or just from the Configuration.

Thank you very much in advance for all replies, advices and answer. Cheers guys..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Try this out

You can programmatically set auto commit to true as in follows

// Load the Oracle JDBC driver

DriverManager.registerDriver(new oracle.jdbc.OracleDriver());

// Connect to the database

// You can put a database hostname after the @ sign in the connection URL.

Connection conn =

DriverManager.getConnection ("jdbc:oracle:oci:@", "scott", "tiger");

// It's faster when auto commit is off

<b>conn.setAutoCommit (true); </b>

// Create a Statement

Statement stmt = conn.createStatement ();

regards

krishna

Answers (3)

Answers (3)

Former Member
0 Kudos

Well not so sure abt this but only 2 wayz that a transaction auto commit can be handled can be:

1) As you have done. Thatz through Adapter Configuration

2) By the DBA.

If there is some other way to do this Please keep on posting.

cheers

Raj

Former Member
0 Kudos

Thanks guys for all the help. So am i correct to state this: (Correct me if I'm wrong)

a. If I unthick the Auto Commit checkbox, therefore there are no other ways to commit / rollback a storedprocedure that called by XI (manually commit/rollback from XI) except i have to put the commit/rollback in the storedprocedure itself.

Former Member
0 Kudos

Wishnu

I believe even the DBA can change the autocommit settings

regards

krishna

Former Member
0 Kudos

Sorry for being unclear from the start. Actually, my purpose is to control the commit/rollback of a stored procedure from XI. Is there any way to do that?

Former Member
0 Kudos

the use of autocommit is mainly inteded for single queries (DML) ...most probably for a stored procedure the transactions are handled inside it say by having multiple savepoints and then rollbacks / commits as per requirement.

so ...check with your stored procedure developers and confirm about the transaction handling inside the SP and in that case the autocommit flag state wont make much difference..:)

HTH

Former Member
0 Kudos

Wardana,

If you see SAP help it says that we should not set this indicator if the JDBC driver supports transactions. Check this SAP help for more information on this:

http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm

Regards,

---Satish

Former Member
0 Kudos

How do we know whether our jdbc driver support transactions or not? Then, if we want to handle the transaction ourself, how do we do that, beside un'thicking' the checkbox? Thank you for your info Satish...

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Rather than the driver, it is purely dependent on the settings on the database.

Contact your DB admin and he should be able to help on what the default setting is.

Regards

Bhavesh