views:

38

answers:

1

I,

I am looking for a way to share a sql connection between two (or more) C/C++ executables.

By sql connection sharing, i mean to have a transactional context in common : the A module can start the transaction, the B module do some work, and the C can commit the transaction.

Of course, if a module wants it, it can throw an exception and the whole shared transaction should be rollbacked.

Do you a a simple solution ? It should work cross platform.

Many thanks for your time,

Olivier

A: 

I don't think you are going to find a generic solution for this. I imagine that result buffer etc are allocated in the context of only one process so connection sharing between processes seems extremely difficult to control.

Transactions also seem near impossible to implement: with two processes running concurrently on the same transaction the most basic aspects of a serialisable transaction seem difficult to control.

Elemental