These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: SQLite error no such table: tablename
PostPosted: Wed May 12, 2010 11:25 am 
Newbie

Joined: Tue Dec 22, 2009 8:38 am
Posts: 18
Hello everyone,

I am sorry if I might be placing this problem on a wrong forum, but after googling several hours in vain, this is my only solution for the problem I am experiencing.

I am implementing the persistence layer with NHibernate and SQLite. I am building dinamically the session configs:
--------------
cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider");
cfg.SetProperty(NHibernate.Cfg.Environment.Dialect, typeof(SQLiteDialect).FullName);
cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionDriver, typeof(SQLite20Driver).FullName);
cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionString, "Data Source=" + Environment.CurrentDirectory + "\\RM.db;Version=3;New=True");
cfg.SetProperty(NHibernate.Cfg.Environment.ShowSql, "true");
cfg.SetProperty(NHibernate.Cfg.Environment.ProxyFactoryFactoryClass, "NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle");
cfg.SetProperty(NHibernate.Cfg.Environment.CurrentSessionContextClass, "thread_static");
cfg.SetProperty(NHibernate.Cfg.Environment.QuerySubstitutions, "true, 1");
cfg.SetProperty(NHibernate.Cfg.Environment.QuerySubstitutions, "false, 0");
--------------------------------

When creating the session object everything is OK, I can see correctly its properties and I dont receive any errors.
The problem occurs when I am calling a method (LoadAll) that loads all the entities of a certain type: it returns me the message SQLite error no such table: [the tablename i am performing the select]

Has anyone experienced something similar ?


Top
 Profile  
 
 Post subject: Re: SQLite error no such table: tablename
PostPosted: Thu May 13, 2010 5:17 am 
Newbie

Joined: Tue Dec 22, 2009 8:38 am
Posts: 18
Problem solved.

The problem was on the line
cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionString, "Data Source=" + Environment.CurrentDirectory + "\\RM.db;Version=3;New=True");
Although the returned path is correct, and I succeed to open a connection to the RM.db, it seems that NHibernate cannot see the tables inside the "main" database.rything went
I have changed this path to "D:\\RM.db" and everything is OK.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.