There I can't get that :memory: to work with ?cache=shared, so it always uses a file in the end.

You need to read the sqlite docs I linked above :)

It is:

I get this with your latest code:-rw-r--r--  1  19456 Jul 24 22:46 file:memdb2?mode=memory&cache=shared

That's interesting. And it may explain the problem under windows.

I was expecting that the uri syntax 'dbi:SQLite:dbname=memdb2?...' would create a file called (just) memdb2.

Ie. That the file: bit was just the URI scheme (equiv. to http:). But it seems that it is being taken as a part of the filename to be used for the db.

Which explains the problem with Windows in as much as Windows uses the syntax filename:streamname to access its Alternate File Streams.

I've also tried all of these different URIs, ...

In order to use your existing file from multiple threads (via multipe connects) you do need to use the URI-form of the connect.

Say your existing file is in the current directory, and is called 'mysqlite.db'; then (I think) you should use the connect string:

CONNECT=> 'dbi:SQLite:dbname=file:mysqlite.db?cache=shared'

If it is in some other place then:

CONNECT=> 'dbi:SQLite:dbname=file:/path/to/mysqlite.db?cache=share +d'

I can't verify this at the moment, so see how you get on with that. (And read the docs to see if you agree with me.)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^11: threads::shared seems to kill performance (Workaround). by BrowserUk
in thread threads::shared seems to kill performance by Jacobs

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.