[freetds] Transactions

Peter Deacon peterd at iea-software.com
Wed May 14 13:09:17 EDT 2003


On Wed, 14 May 2003, John Anderson wrote:

> On Wed, 2003-05-14 at 07:38, Frediano Ziglio wrote:
> > Il mar, 2003-05-13 alle 23:09, John Anderson ha scritto:
> > > On Tue, 2003-05-13 at 22:35, Frediano Ziglio wrote:
> > > > Did you use SQL_HANDLE_ENV or SQL_HANDLE_DBC ??

> > > SQL_HANDLE_DBC. The code I'm using runs correctly with the postgres odbc
> > > driver, and with the EasySoft ODBC-ODBC bridge to a SQL Server 2000
> > > server.

> > Strange. Can you post a snipped of the code ?

> Very strange. I had a look at the internals of SQLEndTran and it looked
> OK to me. So I'm really baffled as to where exactly the error it.

> #ifdef USE_SQL_TRANSACT
> 	_connection.result() = ::SQLTransact (
> 		0
> 		, _connection.handle()
> 		, type
> 	);
> #else
> 	// this gives and invalid handle error with FreeTDS
> 	_connection.result() = ::SQLEndTran (
> 		_connection.handleType()
> 		, _connection.handle()
> 		, type
> 	);
> #endif

> where _connection.handle() returns the SQLHANDLE value,
> _connection.handleType() is a method that returns SQL_HANDLE_DBC, and
> type is a parameter which will be either SQL_COMMIT or SQL_ROLLBACK.

> Maybe I should just do a debug build of freetds and breakpoint
> SQLEndTran to see what it does. Although that might be tricky given that
> the driver manager loads the library?

On the win32 platform using vc++ I can step from my application
into the driver code.

>From what I can tell most unix platforms work the same way... as long as
the driver is physically loaded into the processess address space you
should be able to set breakpoints...etc in the driver itself.

Have Fun!
Peter



More information about the FreeTDS mailing list