Active cache activerecord

Is it possible to use the "shared cache" sqlite3 through activerecord? (see: http://www.sqlite.org/inmemorydb.html )

I am using offline offline mode (no rails) in a JRuby Swing application with some work threads involved. Problem: ONLY the main thread can access the data, since each thread restores a new internal database. So i just

[SQLITE_ERROR] SQL error or missing database (no such table: insert_model_name)

everywhere except the main stream. Is there a workaround or am I missing something? (I use the latest versions of jruby, java and gems)

Thanks in advance!

Database-Config: https://gist.github.com/4482423

UPDATE: A minimal script to illustrate the problem. It works well under Linux, but not in WIndows 7: https://gist.github.com/4483617

+6
source share
1 answer

The following token works well:
"file::memory:?cache=shared"
In addition, check the version of SQLite, it must be at least 3.7.13 to support this function.

+3
source

All Articles