cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Autocommit

Former Member
0 Kudos

Hello

in my scenario i use a proxy=>xi=>jdbc communication.

the jdbc driver is from ca for the database IDMS.

in this driver autocommit is on per default, this is standard for java drivers.

due tue transaction handling i need to send the java command Connection.setAutoCommit(true).

in communication cannel i have disabled autocommit but this dose not fit my problem

any ideas??

regards

ralf

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

ralf,

a bit of confusion in your post

due tue transaction handling i need to send the java command Connection.setAutoCommit(true).

in communication cannel i have disabled autocommit but this dose not fit my problem.

What exactly do you want to achieve? a JDBC autocommit ON or OFF?

The option <b>Database Auto-Commit-Enabled</b> is to be used for

JDBC drivers that do not support transactions.

ralf_zimmerningkat3
Participant
0 Kudos

autocommit should be off, so the JDBC driver handles the transaction.

in my case

the option Auto-Commit is disabled!!

I send 5 sql statements to the target database in one message, and the database commitet after each sql statement. So if statement 4 fails, there was no rollback.

the third party jdbc-driver has per default autocommit = on. The developer of the driver says that t is not possible to change the AutoCommit default, because this is defined in the JDBC description, which is public.

So I have to send the command Connection.setAutoCommit(false) at the begin of the transaction manually.

regards

ralf

Former Member
0 Kudos

Hi,

Please can you check on SAP nOte: 823809

regards

Vijaya

ralf_zimmerningkat3
Participant
0 Kudos

thanks,

but we use already

sap.com SAP-XIAFC 3.0 SP17 (1000.3.0.17.0.20060522230052) SAP AG

so the SAP Note will not fit my problem.

regards

ralf

Former Member
0 Kudos

Ralf,

If the JDBC driver is not going to support the autocommit feature then I wonder how will the call connection.setAutoCommit(false) work?

By default , a JDBC connection when created is always in AutoCommit on mode.

Can you not use a stored procedure and execute all the statements within that and XI taking care of calling the stored procedure.

Former Member
0 Kudos

Amol Joshi,

when by default a JDBC connection ist always in AutoCommit on mode will xi set AutoCommit off by opening a connection?

Is there a way to log this ??

I can not use a stored procedure because the database does not support this.

Former Member
0 Kudos

Did you try setting the <b>Batch Processing</b> indicator?

This indicator actually will collect all the statements to be executed in a batch and they will fail / succeed as a whole.

This will correspond to the Statement.addBatch() / executeBatch() methods.

Former Member
0 Kudos

batch processing does not support sql select statements.

so i cant use this settings.

I think the target database has autocommit on

for all statements and so the jdbc statement will be ignore.

I will call the support for the target database.

in the logview from xi i can see the rollback statement but the target database has already commit the statement.

thanks for helping

regards

ralf

Former Member
0 Kudos

Hi Ralf ,

Instead of sending 5 statement in one transaction , On first statement call some trigger which will have transaction for other 4 statements.

I hope this idea can work.

Thanx & regards

Vinod