Overview
Features
Download
Documentation
Community
Add-Ons & Services

Poco::Data::Session

Please post support and help requests here.

Poco::Data::Session

Postby dr0zaxx » 19 Dec 2012, 05:16

Hello,

Is calling the close() necessary after a Session?

Will there be multiple Session if i keep calling

Code: Select all
Poco::Data::Session session("SQLite", "sample.db");


over and over again or will it act as a singleton and only use the first Session that was created?

Thanks.
dr0zaxx
 
Posts: 2
Joined: 19 Dec 2012, 04:42

Re: Poco::Data::Session

Postby alex » 19 Dec 2012, 09:05

There will be multiple sessions to the same db. See SQlite::Connector
alex
 
Posts: 1086
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Poco::Data::Session

Postby dr0zaxx » 19 Dec 2012, 11:51

@Alex

Thank you for your reply.

I am trying to utilize Poco::Data:SesssionPool

May I know if SQLite is supported?
dr0zaxx
 
Posts: 2
Joined: 19 Dec 2012, 04:42

Re: Poco::Data::Session

Postby alex » 19 Dec 2012, 15:31

dr0zaxx wrote:I am trying to utilize Poco::Data:SesssionPool

May I know if SQLite is supported?

Theoretically, yes. But SessionPool does not do any checking in regards to simultaneous DB access, so what will happen there depends on how you are accessing it. SQLite DB is a single file, thus different from a typical DBMS server handling simultaneous access from many sessions. You could devise your own locking scheme inside the DB to deal with that.
alex
 
Posts: 1086
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Poco::Data::Session

Postby alex » 22 Dec 2012, 00:04

alex wrote:SQLite DB is a single file, thus different from a typical DBMS server handling simultaneous access from many sessions. You could devise your own locking scheme inside the DB to deal with that.

I have to correct this. I thought we were compiling SQLite by default in multi-threaded mode. It is actually compiled in serialized mode and it should be safe to access it from different threads. See Poco::Data::SQLite Makefile and SQLite And Multiple Threads document for details.
alex
 
Posts: 1086
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron