X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FODBC%2FMicrosoft_SQL_Server.pm;h=911ca48d353063313c119e31ec3c6afa584219a5;hb=56ad42bb48befbeb50953d197e7cb86bbc62686c;hp=33b53e30415bd91de67bd57cfe2e9d615cb0e996;hpb=1db83fb9ce3e15d68e2384720ed06af6de5edbac;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm index 33b53e3..911ca48 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm @@ -2,11 +2,14 @@ package DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server; use strict; use warnings; -use base qw/DBIx::Class::Storage::DBI::MSSQL/; +use base qw/ + DBIx::Class::Storage::DBI::ODBC + DBIx::Class::Storage::DBI::MSSQL +/; use mro 'c3'; use Scalar::Util 'reftype'; use Try::Tiny; -use Carp::Clan qw/^DBIx::Class/; +use DBIx::Class::Carp; use namespace::clean; __PACKAGE__->mk_group_accessors(simple => qw/ @@ -21,7 +24,7 @@ to Microsoft SQL Server over ODBC =head1 DESCRIPTION This class implements support specific to Microsoft SQL Server over ODBC. It is -loaded automatically by by DBIx::Class::Storage::DBI::ODBC when it detects a +loaded automatically by DBIx::Class::Storage::DBI::ODBC when it detects a MSSQL back-end. Most of the functionality is provided from the superclass @@ -33,12 +36,13 @@ L. sudo aptitude install tdsodbc libdbd-odbc-perl unixodbc -In case it is not already there put the following in C: +In case it is not already there put the following (adjust for non-64bit arch) in +C: [FreeTDS] Description = FreeTDS - Driver = /usr/lib/odbc/libtdsodbc.so - Setup = /usr/lib/odbc/libtdsS.so + Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so + Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so UsageCount = 1 Set your C<$dsn> in L as follows: @@ -75,6 +79,10 @@ The following options are alternative ways to enable concurrent executing statement support. Each has its own advantages and drawbacks and works on different platforms. Read each section carefully. +For more details about using MAS in MSSQL over DBD::ODBC see this excellent +document provided by EasySoft: +L. + In order of preference, they are: =over 8 @@ -124,7 +132,7 @@ sub connect_call_use_mars { } if ($dsn !~ /MARS_Connection=/) { - if ($self->using_freetds) { + if ($self->_using_freetds) { $self->throw_exception('FreeTDS does not support MARS at the time of ' .'writing.'); } @@ -135,7 +143,7 @@ sub connect_call_use_mars { } if (my ($data_source) = $dsn =~ /^dbi:ODBC:([\w-]+)\z/i) { # prefix with DSN - warn "Bare DSN in ODBC connect string, rewriting as 'dsn=$data_source'" + carp_unique "Bare DSN in ODBC connect string, rewriting as 'dsn=$data_source'" ." for MARS\n"; $dsn = "dbi:ODBC:dsn=$data_source"; } @@ -174,27 +182,32 @@ C, and C