[freetds] Transaction weirdness

James K. Lowden jklowden at schemamania.org
Mon Oct 13 21:49:31 EDT 2003


On 13 Oct 2003, John Anderson <ardour at semiosix.com> wrote:
> On Mon, 2003-10-13 at 06:19, James K. Lowden wrote:
> > I don't think you're being argumentative, John, for the record, and I
> > hope you don't think I am.
> 
> I don't think that. I believe it's better to err on the side of
> politeness when emailing people I don't know ;-)

OK, no worries. :-)

> > Are we talking about server-side cursors here, and if so, what's the
> > state of SQL_COPT_SS_PRESERVE_CURSORS?  
> 
> Ummm, that's not a constant I'm familiar with. I'm looking at it from an
> ODBC point of view.

Have a look at SQLGetConnectAttr.  

> > Does the FreeTDS driver return SQL_CB_CLOSE?  
> 
> To confirm what Peter said - odbc.c:3902
> 
> case SQL_CURSOR_COMMIT_BEHAVIOR:
> 	/* currently cursors are not supported however sql server close
> 	automaticly cursors on commit */ USIVAL = SQL_CB_CLOSE;
> 	break;
> case SQL_CURSOR_ROLLBACK_BEHAVIOR:
> 	USIVAL = SQL_CB_CLOSE;
> 	break;

IOW, yes.  

> I'll have to haul the relevant code out of a set of c++ wrapper classes.
> I'll try to get something to you in the next few days.

I think you'll find it easier, and arrive at a simpler test, if you start
with one of the odbc/unittest/*.c files.  

AIUI, there are two issues:

1.  Respond correctly to SQL_COPT_SS_PRESERVE_CURSORS.
2.  Close cursors automatically on SQLEndTran.  

--jkl


More information about the FreeTDS mailing list