Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-03

SQLite - disk I/O error only on virtual machine

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Krzysztof

Hi,

I noticed strange behavior when running application on virtualbox linux mint 14 64bit machine. This occur only when I attach second database to sqlite3connection and then call SQLTransaction.Commit. This is my code:

  try
    FConn := TMySqlite3Connection.Create(Self);
    FConn.Transaction := SQLTransaction1;
    FConn.DatabaseName :=
IncludeTrailingBackslash(ProgramDirectory)+'db1.sqlite';
    FConn.Connected := True;
    FConn.ExecSQLNoTrans('attach database '+
      QuotedStr(IncludeTrailingBackslash(ProgramDirectory)+'db2.sqlite')+'
as d2');
    FConn.ExecuteDirect('create table if not exists a(col integer)');
    FConn.ExecuteDirect('create table if not exists d2.b(col integer)');
    SQLTransaction1.Commit;
  except on e: Exception do
    ShowMessage(e.Message);
  end;

Even if error occur, commit succesful created tables. When I run it on normal Linux installation (also Mint 14 64bit) then everything is ok. Both OS have same sqlite version (3.7.13) from ubuntu repo. I will post this report on sqlite mailing list too, but maybe you had similar problem.

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130307/e47595c1/attachment.html>

Reply by email

Michael Van Canneyt
to Krzysztof
Krzysztof wrote 14 lines
Hi, I noticed strange behavior when running application on virtualbox linux mint 14 64bit machine. This occur only when I attach second database to sqlite3connection and then call SQLTransaction.Commit. This is my code: ? try ? ? FConn := TMySqlite3Connection.Create(Self); ? ? FConn.Transaction := SQLTransaction1; ? ? FConn.DatabaseName := IncludeTrailingBackslash(ProgramDirectory)+'db1.sqlite'; ? ? FConn.Connected := True; ? ? FConn.ExecSQLNoTrans('attach database '+ ? ? ? QuotedStr(IncludeTrailingBackslash(ProgramDirectory)+'db2.sqlite')+' as d2'); ? ? FConn.ExecuteDirect('create table if not exists a(col integer)'); ? ? FConn.ExecuteDirect('create table if not exists d2.b(col integer)');

AFAIK these commands are automatically committed by SQLite.

see e.g.
http://sqlite.1065341.n5.nabble.com/DDL-statements-in-transactions-td37849.html

Michael.

Reply by email

Ludo Brands
to Krzysztof: I noticed strange behavior when running application on virtualbox linux mint 14 64bit…
Krzysztof wrote 6 lines
Hi, I noticed strange behavior when running application on virtualbox linux mint 14 64bit machine. This occur only when I attach second database to sqlite3connection and then call SQLTransaction.Commit. This is my code:

<snip>

Show quoted text 7 lines
Even if error occur, commit succesful created tables. When I run it on normal Linux installation (also Mint 14 64bit) then everything is ok. Both OS have same sqlite version (3.7.13) from ubuntu repo. I will post this report on sqlite mailing list too, but maybe you had similar problem.

Try running with strace to see where exactly the problem is, IF there is really an IO problem.

Ludo

Reply by email

Luca Olivetti
to Krzysztof: I noticed strange behavior when running application on virtualbox linux mint 14 64bit…

Al 07/03/13 20:50, En/na Krzysztof ha escrit:

Show quoted text 5 lines
Hi, I noticed strange behavior when running application on virtualbox linux mint 14 64bit machine. This occur only when I attach second database to sqlite3connection and then call SQLTransaction.Commit. This is my code:

Does the database file reside in a shared folder?
Those don't work too well in VirtualBox, at least they don't work here with a linux host and a windows xp guest.
I had to use samba on the host to share folders and even then I had to disable kernel oplocks.

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007

Reply by email