Hi,
I ran into a concurrency problem with my Perl / CGI application. It uses a Microsoft Access database for data storage. I noticed that if I run a DELETE query and then a SELECT right after it, I get results that include the deleted records. If I insert sleep(1) command between the two database calls, I get the correct results. It seems to me that this behavior results from the way Access processes/caches query requests.

I am at the point where I think I need to lock the table to which I am doing the updates, but I am not sure how to do it using DBI module. I searched in groups.google.com, DBI documention and here, but couldn't find an answer. I know that Access is probably not a good choice for a multiuser application, but, if it all possible, I want to use Access initially and then switch over to something else (SQL Server or Oracle).

There's a way to lock records using ADO provider for Access, but I want to stick with DBI / ODBC for now. Could anyone give me any hints, comments, or pointers on this?

Thank you,
Alex


In reply to Locking tables in Access database using Perl DBI by relax99

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.