Overview
Features
Download
Documentation
Community
Add-Ons & Services

Problem opening SQLite Session on Mac OS X

Please post support and help requests here.

Problem opening SQLite Session on Mac OS X

Postby poksi592 » 12 Nov 2012, 19:00

Hi,

I have pretty much straight forward test project, that works fine on Windows. I took the project and I "moved" it to the Mac on Xcode. There is something I don't understand:

- if I give to the constructor method anything else than only filename as connection string, t.i. fill name with path, constructor method is unsuccessful. i.e. "test.db" works and "Macintosh HD/Users/TheUser/test.db" doesn't...
- although test application executer normally and returns no errors of whatsoever, the file test.db is never created...

Thanks for your help!
poksi592
 
Posts: 16
Joined: 01 Feb 2012, 12:12

Re: Problem opening SQLite Session on Mac OS X

Postby rakesh » 13 Nov 2012, 00:07

Your path is wrong if you prefix it with "Macintosh HD". Did you try just "/Users/TheUser/test.db"?
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago

Re: Problem opening SQLite Session on Mac OS X

Postby poksi592 » 13 Nov 2012, 06:46

@Rakesh, yes, of course. Same result.
poksi592
 
Posts: 16
Joined: 01 Feb 2012, 12:12

Re: Problem opening SQLite Session on Mac OS X

Postby rakesh » 13 Nov 2012, 15:23

That is strange. I have been testing the SQLite interface on my Mac through a unit test suite, and then verifying the database through the sqlite3 command line shell. My code is more or less similar to the following:

Code: Select all
Connector::registerConnector();
poco_information( logger, "Registered SQLite Connector" );

pool = new SessionPool( Connector::KEY, "/tmp/uma.db" );
poco_information( logger, "PersistenceManager initialised" );
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago

Re: Problem opening SQLite Session on Mac OS X

Postby poksi592 » 13 Nov 2012, 17:51

hm, does it work also on other, non superuser directories, like mine?
poksi592
 
Posts: 16
Joined: 01 Feb 2012, 12:12

Re: Problem opening SQLite Session on Mac OS X

Postby rakesh » 13 Nov 2012, 18:06

Yes, it works in any directory the current user has write privileges to. /tmp is not a superuser directory, it is all user directory.
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago

Re: Problem opening SQLite Session on Mac OS X

Postby poksi592 » 13 Nov 2012, 19:04

@Rakesh, thanks for your help. The problem was that it hasn't worked with "SQLite" as a parameter for Session, but the Connector::KEY instead. I wonder, how "SQLite" has worked fine on windows? :shock:
poksi592
 
Posts: 16
Joined: 01 Feb 2012, 12:12

Re: Problem opening SQLite Session on Mac OS X

Postby alex » 14 Nov 2012, 18:58

poksi592 wrote:The problem was that it hasn't worked with "SQLite" as a parameter for Session, but the Connector::KEY instead. I wonder, how "SQLite" has worked fine on windows?

Connector name is kept lowercase internally so it should not make the difference. What does your code look like and what POCO version are you using?
alex
 
Posts: 1145
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Problem opening SQLite Session on Mac OS X

Postby poksi592 » 16 Nov 2012, 01:16

Hi, Alex,

This is the code:

SQLite::Connector::registerConnector();
//databaseSession=new Session("SQLite",connectionstring);
databaseSession=new Session(SQLite::Connector::KEY,connectionstring);

The code that didn't work is commented out. Second line is used instead.
poksi592
 
Posts: 16
Joined: 01 Feb 2012, 12:12


Return to Support

Who is online

Users browsing this forum: guenter and 2 guests