note
punkish
Hi [james2vegas], sorry for the delay in reply.
<p>
Well, I thought I had surmounted this problem, but no, it is back with a vengeance. Here is what is going on in a single web action --
<p>
<code>
SELECT col1 FROM table WHERE condition;
if (col1 exists) {
UPDATE table SET col2 = <new value>
}
</code>
<p>
Well, I get the "db is locked" error at the UPDATE statement. Now, in my httpd.conf I started using
<p>
<code>
PerlModule Apache::DBI
</code>
<p>
and I thought my troubles were over. Except, this lock problem has started rearing up again. I have tried a few other things, such as starting every db action with <code>$dbh->begin_work</code> and ending with <code>$dbh->commit</code>, but I am already using <code>AutoCommit => 1</code> so I am not sure if that even has any effect. I have even tried <code>sqlite_use_immediate_transaction => 1</code>, but that doesn't help either.
<p>
My application is being loaded in Apache conf file with
<p>
<code>
<Location />
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
PerlSetVar psgi_app /path/to/application.pl
</Location>
</code>
<p>
So, I want all the perl modules to be loaded when Apache2 starts, and then a $dbh created for each user when the user comes to the web site, but not recreated for the same user on every reload. I am assuming that would be the correct way to work speedily.
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-231169">
--
<br><br><i>
when small people start casting long shadows, it is time to go to bed</i>
</div></div>
863104
863129