cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC commit order

Former Member
0 Kudos

Hello, sdners! I have a doubt about JDBC Adapter. If I have an insert statement like following, how many commits will be executed? 1, 2 or 3? And when will it be executed?

<StatementName2>

<dbTableName action=u201DINSERTu201D>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2</col2>

</access>

<access>

<col1>val11</col1>

</access>

</dbTableName>

</StatementName2>

<StatementName2>

<dbTableName action=u201DINSERTu201D>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2</col2>

</access>

</dbTableName>

</StatementName2>

Thanks in advance!

Regards

Federico

Accepted Solutions (1)

Accepted Solutions (1)

former_member182004
Contributor
0 Kudos

Hi Fede,

You'll have one commit for every "statement", in your case, 2 commits.. one for each Insert.

Regards,

Juan.

Answers (1)

Answers (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

Fede,

you will have one commit per statements coz each statements corresponde to two differents SQL statements, in this case two inserts. similar case if you instead of execute an SQL Statement you call an statatement that execute an SP and another statement that execute an SQL Statemtent, you have two stataments no matter which action each one execute you have two commits

Former Member
0 Kudos

Thanks both. Points awarded. Another question... what about if first statement has an error and second one works?

It would perform a rollback and then a commit?

Former Member
0 Kudos

>what about if first statement has an error and second one works?

It would perform a rollback and then a commit?

That is correct.