in reply to Re: dbi & threads
in thread dbi & threads
The problem, i suppose, that $dbh is counted as a scalar, not as db handle object.package Probe::DBI; use strict; use warnings; use threads; use threads::shared; use base qw(Class::DBI::MSSQL); my $dbh; share($dbh); $dbh = &share({}); bless($dbh, __PACKAGE__.'::db'); sub db_Main { unless ($dbh->{Active}) { $dbh = &share(DBI->connect_cached('dbi:ODBC:DRIVER={SQL Server +};Server=moproj24;TargetDSN=probe', 'pr_user', 'pr_user', { __PACKAGE +__->_default_attributes() })); } return $dbh; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: dbi & threads
by Corion (Patriarch) on Jul 10, 2006 at 16:13 UTC |