Robert Wallner wrote:
Even the smallest sql statement (like PRAGMA temp_store = 1) triggers
this behaviour when using sqlite 3.3.x. I forgot to mention that I
connect to a :memory: database and then attach 2 database to the
connection.
I've been using the apsw and pysqlite wrappers for some time now and
haven't seen this problem. After running the PythonWin sessions below
(on XP) memory usage (in both cases) is under 10MB.
On Debian Sarge running a similar python session (sqlite 2.8.16 though)
and a sqlite 3.2.1 session on the memory usage in both cases is under 5MB.
Have you a smallish test case?
Martin
PythonWin 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
on win32.
Portions Copyright 1994-2004 Mark Hammond ([EMAIL PROTECTED]) -
see 'Help/About PythonWin' for further copyright information.
from pysqlite2 import dbapi2 as sqlite3
CM=sqlite3.connect(":memory:")
C1=sqlite3.connect("db1")
C2=sqlite3.connect("db2")
C1.execute("create table t1(i INTEGER, t TEXT)")
<pysqlite2.dbapi2.Cursor object at 0x00CDBF50>
C2.execute("create table t2(i INTEGER, t TEXT)")
<pysqlite2.dbapi2.Cursor object at 0x00CDBF80>
CM.execute("create table tm(i INTEGER, t TEXT)")
<pysqlite2.dbapi2.Cursor object at 0x00CDBF50>
CM.execute("attach database db1 as db1")
<pysqlite2.dbapi2.Cursor object at 0x00CDBF80>
CM.execute("attach database db2 as db2")
<pysqlite2.dbapi2.Cursor object at 0x00CDBF50>
CM.execute("insert into tm values(1,'one')")
<pysqlite2.dbapi2.Cursor object at 0x00CDBF80>
sqlite3.version, sqlite3.sqlite_version
('2.2.1', '3.3.5')
PythonWin 2.5b2 (r25b2:50512, Jul 11 2006, 10:16:14) [MSC v.1310 32 bit
(Intel)] on win32.
Portions Copyright 1994-2004 Mark Hammond ([EMAIL PROTECTED]) -
see 'Help/About PythonWin' for further copyright information.
import sqlite3
CM=sqlite3.connect(":memory:")
C1=sqlite3.connect("db1")
C2=sqlite3.connect("db2")
C1.execute("create table t1(i INTEGER, t TEXT)")
<sqlite3.Cursor object at 0x00D09C20>
C2.execute("create table t2(i INTEGER, t TEXT)")
<sqlite3.Cursor object at 0x00D09B60>
CM.execute("create table tm(i INTEGER, t TEXT)")
<sqlite3.Cursor object at 0x00D09C80>
CM.execute("attach database db1 as db1")
<sqlite3.Cursor object at 0x00D09C50>
CM.execute("attach database db2 as db2")
<sqlite3.Cursor object at 0x00D09C20>
CM.execute("insert into tm values(1,'one')")
<sqlite3.Cursor object at 0x00D09BC0>
sqlite3.version, sqlite3.sqlite_version
('2.3.2', '3.3.4')
[EMAIL PROTECTED]:~$ python2.4
Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite
>>> CM=sqlite.connect(":memory:")
>>> C1=sqlite.connect("db1")
>>> C2=sqlite.connect("db2")
>>> cm=CM.cursor()
>>> c1=C1.cursor()
>>> c2=C2.cursor()
>>> cm.execute("create table tm(i INTEGER, t TEXT)")
>>> c1.execute("create table t1(i INTEGER, t TEXT)")
>>> c2.execute("create table t2(i INTEGER, t TEXT)")
>>> C1.commit()
>>> C2.commit()
>>> C1.close()
>>> C2.close()
>>> cm.execute("attach database db1 as db1")
>>> cm.execute("attach database db2 as db2")
>>> cm.execute("insert into tm values(1,'one')")
>>> cm.execute("select * from tm")
>>> cm.fetchall()
[(1, 'one')]
>>> sqlite.version, sqlite._sqlite.sqlite_version()
('1.0.1', '2.8.16')
>>>