NAME

DBIO::Sybase::Storage::FreeTDS - Base class for drivers using DBD::Sybase over FreeTDS.

VERSION

version 0.900007

DESCRIPTION

Base storage class for DBD::Sybase connections using the FreeTDS library. It is a subclass of DBIO::Sybase::Storage and is mixed in automatically by DBIO::Sybase::Storage when FreeTDS is detected.

Provides FreeTDS-specific transaction management (explicit BEGIN TRAN, COMMIT, ROLLBACK) and text size handling via SET TEXTSIZE, since $dbh->{LongReadLen} is not available under FreeTDS.

METHODS

set_textsize

When using DBD::Sybase with FreeTDS, $dbh->{LongReadLen} is not available, use this function instead. It does:

$dbh->do("SET TEXTSIZE $bytes");

Takes the number of bytes, or uses the LongReadLen value from your connect_info if omitted, lastly falls back to the 32768 which is the DBD::Sybase default.

TRANSACTIONS AND OPEN CURSORS

DBD::Sybase runs a statement on a database handle that has an active statement handle (an open cursor, or a statement the server refused at prepare) over a second connection. BEGIN TRAN, COMMIT and ROLLBACK would then miss the session of the transaction while the storage counted on as if they had not. So, when the connection has an active statement handle:

  • ROLLBACK -- also that of a txn_scope_guard and of txn_do -- finishes every active statement handle of the connection first and rolls back on the same connection. A cursor read across the rollback is ended by it; that is the price.

  • BEGIN TRAN throws an exception that names the open cursor, before anything is sent. The storage is as it was, transaction_depth included. Read the cursor to its end, or finish it, first.

  • COMMIT throws the same exception before anything is sent. The core treats it like any failed commit of the outermost transaction: the transaction is over. The storage finishes the cursor and sends ROLLBACK on the same connection, transaction_depth is 0, and the caller gets the error of the COMMIT. Nothing of the transaction is kept; read the cursor to its end, or finish it, before the commit.

Nothing is ever sent on a second connection silently. Without an active statement handle nothing changes.

SEE ALSO

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.