Right. Now i'm trying to set up threads::shared $dbh. No good so far.
This class is used as a base for all my cdbi classes:
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;
}
The problem, i suppose, that $dbh is counted as a scalar, not as db handle object.
dbih_getcom handle threads::shared::tie=SCALAR(0x200f4d4) is not a DBI handle at c:/Perl/site/lib/Im
a/DBI.pm line 381.
Compilation failed in require at Probe/ProbeTask.pm line 10.
BEGIN failed--compilation aborted at Probe/ProbeTask.pm line 10.
Compilation failed in require at Probe/ProbeUser.pm line 11.
BEGIN failed--compilation aborted at Probe/ProbeUser.pm line 11.
Compilation failed in require at ./probe.pl line 9.
BEGIN failed--compilation aborted at ./probe.pl line 9.
Can you explain me how to get work?
Thanks,
Artem A. Avetisyan.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.