Closed Perlover closed 11 years ago
On Feb 12, 2013, at 11:43 AM, Perlover notifications@github.com wrote:
Good day!
Thanks for nice module! But i have question for future using.
Suppose i made everywhere like this:
my $sth = $conn->dbh->prepare(..);
Then by some reasons a connection was lost. Your module made auto-reconnect and as i understand after reconnect will be:
$conn->dbh != $old_dbh
Yes?
Correct.
And question: can i use $sth after reconnect (auto-reconnect is transparent so this will be difficult to check this every time) or should i do prepare again?
You would need to prepare again. This is what makes txn() blocks so useful.
And same question for fork situations: if i made and got $sth in parent, then made fork - can i use $sth in child without new prepare?
No, you need to re-prepare.
HTH,
David
Good day!
Thanks for nice module! But i have question for future using.
Suppose i made everywhere like this:
Then by some reasons a connection was lost. Your module made auto-reconnect and as i understand after reconnect will be:
Yes?
And question: can i use $sth after reconnect (auto-reconnect is transparent so this will be difficult to check this every time) or should i do
prepare
again? And same question for fork situations: if i made and got $sth in parent, then madefork
- can i use $sth in child without newprepare
?I am interested for situations when i use $sth outside of
txn
,run
methods. I understand if i will make sub {} withfixup
method whereprepare
will be - it will work fine: a prepare will rerun. But for old programs i cannot remake logic to your module quickly and in my projects i use $sth outside. If i use DBD::mysql module - there i has mysql_auto_reconnect totrue
.Thanks!