Local Transaction in jdbc adapter

Hi Users,

I have gone through the JDBC Adapter Guide…for adapter connection…
but Local transaction is still not clear to me .How it work in real scenario …
can any one give me the Example for local transaction…

Please can any one help for explaning it…:confused:

Hello All,

can you please help me to clear this …

You said you do not understand only local transaction it means you understood xa transaction. it is little weird to me. But ok please let me know what you do not understand exactly in local transaction.

Regards,
Vikas

Hi Vikas,

In the Local Transaction by guide line its very clear that in this transcation in which multiple actions on a resource(database) are treated as a single unit and are all committed or rolled back together.
all the operation perform only in one database and if there is any problem occure to update the info. it will rollback from there…

But I need to know any example for that …
Thanks for you input…can you please suggest any example for that…

No transaction – means the DB manages the transaction (not IS); this is “auto-commit”
Local transaction – means IS manages the transaction; can only involve one Local transaction connection and 0 or more “No transaction” connections
XA transaction – means IS manages the transaction and can handle distributed transactions (operation over more than 1 database)

Local transaction means in a single transaction we can do multiple operations on a single database. To be more clear all these multiple operations use the same Adapter connection.
XA transaction means in a single transaction we can do multiple operations on different databases.
To be more clear all these multiple operations use different Adapter connection.

Hi Mukesh,
Local transaction can be used in two ways. First one is using transaction boundry and second one is without using transaction boundry (Not recommended instead use NO_Transaction). When you do not define transaction boundry then local transaction behaves as no transaction. When you use transaction boundry then you start the local transaction for one database and do the necessary action and at last you commit all your action and incase of error you roll back all your changes.

For Ex: you have list of 100 document and all has to be inserted into database and comit will be done when all document inserted successfully else rollback will be called.

NOTE: Never use two local transaction in a same flow service without defining transaction boundry.

Regards,
Vikas

1 Like

Thanks you very much Vikas ,Reamon and Mahesh for making the clear idea about the Local Transaction …

Really its very much clear to me know…Thanks you very much…:slight_smile:

This is close but not quite accurate.

The description of XA transaction is correct.

But the Local Transaction description is a bit off. When using Local Transaction for DB activity one can use multiple connection pools as long as only one of them is defined with Local Transaction and the others are No Transaction.

1 Like

Hi,

In local transaction, when we use mulitple operations for with same adapter connection . Any error in one operation roll backs the other operations.

Thanks,
Sathya

Hi,

When NO_Transaction auto commits the transactions, what do we do in case of any errors?
To be more clear for example, we are performing an insert of 100 rows into a table and have used NO_transaction as transaction type. The connection is lost after inserting some 40 rows and the transaction has failed. As it is an auto commit and we cannot roll back this transaction, what do we do in this case?

When it has this drawback, why do we use NO_transaction? where exactly do we use no_transaction?

please give me an example for each type of transaction

You have to use local transaction connection. To handle commit or rollback use the services present in WmART package.

For more details refer jdbc adapter guide.

where do we use NO_transaction then?

In what situation do we use NO_transactions?

Use no transaction for select and local transaction for any DML (insert, delete, update) operations to handle the transaction boundary (via start, commit and rollback).

As per your need, you go with local tx to handle the transaction manually.

"In local transaction, when we use mulitple operations for with same adapter connection . Any error in one operation roll backs the other operations. "

Iam using local transaction when error in one operation then roll back not happening in all the other successful operations, may i know what might be the reason ?

This was working fine previously, not working after I changed few mappings to the adapter service.

Hello Sandeep,

I would suggest you create a new thread and do not hijack an old thread. Provide all the details including the IS and fix levels and also a code snippet if possible.