Re: supported ODBC attributes - progress

"ZIGLIO, Frediano, VF-IT" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
...
> 
> > The fellow who maintains the OTL library wrote to me 
> because our ODBC
> > driver faked him out: 
> > 
> >     status=SQLSetConnectAttr
> >     (hdbc,
> >      SQL_ATTR_TXN_ISOLATION,
> >      ...
> > 
> > SQLGetInfo says the driver supports all isolation levels:
> > 
> > 	case SQL_TXN_ISOLATION_OPTION:
> > 		/* TODO check SQLSetConnectAttr support */
> > 		UIVAL = SQL_TXN_READ_COMMITTED | 
> > SQL_TXN_READ_UNCOMMITTED |
> > SQL_TXN_REPEATABLE_READ | SQL_TXN_SERIALIZABLE;
> > 
> > SQLGetConnectAttr/SQLSetConnectAttr report success for all 
> > those, and it's
> > faithfully stored in dbc->attr.txn_isolation.  
> > 
> > Trouble is, txn_isolation is never used.  :-(
> >
> 
> I saw. Perhaps the confusion is caused by SQLGetInfo that mix server
> informations with driver ones.
> I'll write a test to check what happen changing isolation level during
> connection, after connection and using implicit transactions in odbc.
>  

Actually I added transaction level setting
http://freetds.cvs.sourceforge.net/freetds/freetds/src/odbc/unittests/tr
ansaction2.c?revision=1.1&view=markup
and a test
http://freetds.cvs.sourceforge.net/freetds/freetds/src/odbc/unittests/tr
ansaction2.c?revision=1.1&view=markup
still missing
- test setting before connection (shold work)
- test setting wrong constant (check error returned)
- test setting with active transaction (check error returned)
- test setting with pending data (check error returned)
I don't know if backporting or changing 

  case SQL_TXN_ISOLATION_OPTION:
    /* TODO check SQLSetConnectAttr support */
    UIVAL = SQL_TXN_READ_COMMITTED | SQL_TXN_READ_UNCOMMITTED |
SQL_TXN_REPEATABLE_READ | SQL_TXN_SERIALIZABLE;
    break;

in

  case SQL_TXN_ISOLATION_OPTION:
    UIVAL = SQL_TXN_READ_COMMITTED;
    break;

in 0.82 branch.

...

freddy77
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.