Forum Stats

  • 3,814,867 Users
  • 2,258,922 Discussions
  • 7,892,882 Comments

Discussions

How to use sequence in TDS?

tiplip
tiplip Member Posts: 28

I have multiple DBs in a multiple threaded application, meanwhile, it's on TDS, and I'd like to enalbe each DB to increment its key automatically, what question should I be careful?

1. create sequence db for each its caller DB?

2. wrap sequence db->get like this?

begain transaction;

key = sequence_db->get;

put data into main db with key;

commit transaction;

or abort transaction

can I rollback to retry if something exception happens?

Tagged:
This discussion has been closed.