0

Is there a way to give a identifier for Postgresql transaction. Ex :

 begin transaction a;
 ...

If not, will this be supported in future.

I'm asking this if transaction has identifiers then true asynchronous database call will be possible with frameworks like Netty or Vert.x

0

No, you can't assign a transaction an arbitrary user-defined identifier.

Transactions already have transaction IDs, but only read/write transactions get true, persistent ones.

I'm asking this if transaction has identifiers then true asynchronous database call will be possible with frameworks like Netty or Vert.x

Having a transaction identifier would do you no good there anyway.

  • Why having a transaction identifier would do no good ? If a transaction has a identifier won't it allows to commit it later or rollback ? Application can initiate a transaction carry the identifier throughout process and it can commit or rollback later. – Viraj Oct 16 '14 at 6:03
  • @Viraj It sounds like you want to multiplex transactions over one connection. You can't do that. Transaction identifiers aren't the issue, it's that you cannot suspend and resume transactions, and there can only be one tranasaction in progress at a time on any given connection. So you need one connection per tx, and in that case you already have a convenient handle to associate transactions. – Craig Ringer Oct 16 '14 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.