[freetds] FreeTDS 0.82 no longer has tds.h installed?

James K. Lowden jklowden at freetds.org
Sat Apr 19 16:12:03 EDT 2008


Dossy Shiobara wrote:
> 
> On 2008.04.19, James K. Lowden <jklowden at freetds.org> wrote:
> > Both FreeTDS and the AOLserver project would be better off if
> > AOLserver used a client library instead.  
> 
> Has someone verified thread-safety, all the way through the client
> library layer?

Hi Dossy, 

I don't know about "verified".  db-lib doesn't permit multiple threads to
share a connection, but we assert it's otherwise thread-safe.  

> This was, IIRC, the primary reason why I went straight to the tds_*
> functions rather than trying to use db-lib or ct-lib.  

db-lib was invented a decade before multithreading.  ct-lib should be
threadsafe, period, according to Sybase's specification cf.
http://manuals.sybase.com:80/onlinebooks/group-cn/cng1251e/ctref/@Generic__BookTextView/12662;pt=13641#X.
 

That said, ct-lib, although it supports DBD::Sybase and sqsh acceptably,
is the weak sister nowadays, with no one actively adding to it.  Your
involvement could change that, which is what I meant by both projects
benefitting.  Instead of maintaining something special to AOLserver, you'd
be maintaining a generalized, well defined interface.  

> I don't see how to set the TDS
> protocol version any more.  Previously, it was easy as invoking
> tds_set_version().  Is this done through dbsetlversion()?  

Ouch!  tds_set_version still works.  dbsetlversion is how db-lib Microsoft
specifies the same idea in db-lib.  FreeTDS implements it as defined by
Microsoft, but it could be generalized.  

We should probably invent "dbsettdsversion()" as the inverse of dbtds().  

> Does db-lib or ct-lib offer millisecond-granularity timeouts?  Or, is it
> in whole seconds?  

No, but we could discuss ways to make that possible.  

I'm a little surprised this is a requirement, insofar as database drivers
generally can't be depended on for that kind of granularity.  ODBC
SQL_ATTR_CONNECTION_TIMEOUT is specified in seconds.  Timeout handling was
quite broken in FreeTDS prior to 0.82.  

> I guess nsfreetds operates like just another "client library" for
> AOLserver application code.  Perhaps I'll look and see what it will take
> to build libtds again in 0.82.  Thanks for the idea.

Always happy to help another free software project! 

I think you'll find that the static library libtds.a is built.  You
probably just need to copy the headers and the library to your standard
tree and re-link.  
Regards, 

--jkl



More information about the FreeTDS mailing list