Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite locks up #98

Open
uint opened this issue Nov 28, 2017 · 0 comments
Open

SQLite locks up #98

uint opened this issue Nov 28, 2017 · 0 comments

Comments

@uint
Copy link

uint commented Nov 28, 2017

I'm trying to use SQLite with the Using session example. Since at first I was getting a "table does not exist" error, I created a sessions table on my own:

CL-USER> (datafly.db:connect-toplevel :sqlite3 :database-name #P"test.db")
#<DBD.SQLITE3:<DBD-SQLITE3-CONNECTION> {10051B2653}>
CL-USER> (datafly.db:execute (sxql:create-table :sessions ((id :type '(:int 20) :primary-key t :unique t) (session_data :type '(:varchar 2048) :not-null nil :default nil))))
; No value
CL-USER> (datafly.db:disconnect-toplevel)
NIL

It does look like some session data gets stored as I open served pages in my browser, but then when I open a page that actually tries to store some session data (the counter thing from the example), I get:

DB Error: database is locked (Code: BUSY)
   [Condition of type DBI.ERROR:<DBI-DATABASE-ERROR>]

Restarts:
 0: [ABORT] abort thread (#<THREAD "hunchentoot-worker-127.0.0.1:51360" RUNNING {1001DE5113}>)

Backtrace:
  0: ((:METHOD DBI.DRIVER:PREPARE (DBD.SQLITE3:<DBD-SQLITE3-CONNECTION> STRING)) #<DBD.SQLITE3:<DBD-SQLITE3-CONNECTION> {1003595743}> "SELECT session_data FROM sessions WHERE id = ?") [fast-method]
  1: ((:METHOD LACK.MIDDLEWARE.SESSION.STORE:FETCH-SESSION (LACK.MIDDLEWARE.SESSION.STORE.DBI:DBI-STORE T)) #S(LACK.MIDDLEWARE.SESSION.STORE.DBI:DBI-STORE :CONNECTOR #<FUNCTION (LAMBDA NIL :IN "/mnt/Data/C..
  2: ((LAMBDA (LACK.MIDDLEWARE.SESSION::ENV) :IN "/mnt/Data/Code/endsec/end-world/ql-world-2017-08/software/lack-20170830-git/src/middleware/session.lisp") (:REQUEST-METHOD :GET :SCRIPT-NAME "" :PATH-INFO ..
  3: (LACK.UTIL:FUNCALL-WITH-CB #<CLOSURE (LAMBDA (LACK.MIDDLEWARE.SESSION::ENV) :IN "/mnt/Data/Code/endsec/end-world/ql-world-2017-08/software/lack-20170830-git/src/middleware/session.lisp") {10089A483B}>..
  4: ((LAMBDA (LACK.MIDDLEWARE.BACKTRACE::ENV) :IN "/mnt/Data/Code/endsec/end-world/ql-world-2017-08/software/lack-20170830-git/src/middleware/backtrace.lisp") (:REQUEST-METHOD :GET :SCRIPT-NAME "" :PATH-I..
  5: ((:METHOD HUNCHENTOOT:ACCEPTOR-DISPATCH-REQUEST (CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR T)) #<CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR (host *, port 5000)> #<HUNCHENTOOT:REQUEST {10035934D3}>) [fa..
  6: ((:METHOD HUNCHENTOOT:HANDLE-REQUEST (HUNCHENTOOT:ACCEPTOR HUNCHENTOOT:REQUEST)) #<CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR (host *, port 5000)> #<HUNCHENTOOT:REQUEST {10035934D3}>) [fast-method]
  7: ((:METHOD HUNCHENTOOT:PROCESS-REQUEST (T)) #<HUNCHENTOOT:REQUEST {10035934D3}>) [fast-method]
  8: (HUNCHENTOOT::DO-WITH-ACCEPTOR-REQUEST-COUNT-INCREMENTED #<CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR (host *, port 5000)> #<CLOSURE (LAMBDA NIL :IN HUNCHENTOOT:PROCESS-CONNECTION) {100359288B}>)
  9: ((:METHOD HUNCHENTOOT:PROCESS-CONNECTION (HUNCHENTOOT:ACCEPTOR T)) #<CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR (host *, port 5000)> #<USOCKET:STREAM-USOCKET {1001DD7AE3}>) [fast-method]
 10: ((:METHOD HUNCHENTOOT:PROCESS-CONNECTION :AROUND (HUNCHENTOOT:ACCEPTOR T)) #<CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR (host *, port 5000)> #<USOCKET:STREAM-USOCKET {1001DD7AE3}>) [fast-method]
 11: ((:METHOD HUNCHENTOOT:PROCESS-CONNECTION :AROUND (CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR T)) #<CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR (host *, port 5000)> #<USOCKET:STREAM-USOCKET {1001DD7AE3}>)..
 12: ((FLET HUNCHENTOOT::PROCESS-CONNECTION% :IN HUNCHENTOOT::HANDLE-INCOMING-CONNECTION%) #<CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR (host *, port 5000)> #<USOCKET:STREAM-USOCKET {1001DD7AE3}>)
 13: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
 14: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
 15: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
 16: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-THREAD::CALL-WITH-MUTEX))
 17: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFEF50ED5B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THR..
 18: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "hunchentoot-worker-127.0.0.1:51360" RUNNING {1001DE5113}> NIL #<CLOSURE (LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS) {..
 19: ("foreign function: call_into_lisp")
 --more--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant