[unixODBC-support] Problem with achieving Serialization mode with unixODBC inspite it is working with Postgres

Aditi mittal aditimittal15 at gmail.com
Tue Jun 25 11:17:39 BST 2013


Hi,

I have an Application using unixodbc to access postgres server. Since, our
system is multithreaded environment where in multiple threads can access
the DB server simultaneuosly.
Hence for consistency issue, I need to set isolation mode to Serializable
for a given transaction.

I tried to by setting connection attribute by following two commands:
res = SQLSetConnectAttr(*phdbc,SQL_ATTR_TXN_ISOLATION,
(SQLPOINTER)SQL_TXN_SERIALIZABLE,SQL_NTS);
res = SQLSetConnectOption( phdbc,SQL_TXN_ISOLATION,SQL_TXN_REPEATABLE_READ
);


But through none of them I could achieve serialized before. i.e.
Say serialized Trans T1 was ongoing, when there is Update on same record
through another serialized txn T2. Now in T1 I tried Update procedure on
same record.

Ideally in serialized mode, T1 should wait for T2 to commit and after that
it should return error saying  transactions are not concurrent due to
serialized txn.

But in myprogram both updates are being done successfully. and final result
remains the update done by txn T1 on that record.

So could you please help me out and let me know what wrong I have been
doing.
Unixodbc rpm in use: unixODBC-2.2.11-1.i386.rpm
Postgres in use: postgresql-9.2.4.tar.bz2

Regards,
Aditi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20130625/250861dd/attachment.html>


More information about the unixODBC-support mailing list