SQLite testing - what am I doing wrong.

8 views
Skip to first unread message

Aaron Peterson

unread,
Oct 27, 2009, 5:59:00 PM10/27/09
to DbLinq
I am doing some testing with DBLinq and SQLite. I want to test a few
commands to see how well it all performs.

I am stuck on my first test app though.

Please can someone tell me what I am doing wrong?

string connStr = "Data Source=c:\\Individual Project\
\Tooling.db3;Version = 3;";
Tooling tool = new Tooling(new XSqlConnection(connStr));
Sanders insertSander = new Sanders();
insertSander.OverallDiam = 2;
insertSander.Height = 1;
if(tool.DatabaseExists())
{
tool.Sanders.InsertOnSubmit(insertSander);
tool.SubmitChanges();
}

I get an error :Object already attached.

Please help.

Jonathan Pryor

unread,
Oct 27, 2009, 7:57:07 PM10/27/09
to dbl...@googlegroups.com
1. Which version is this?

2. How did you create the Tooling type? Presumably with DbMetal, but
specifically did you pass a /provider option?

2.b: If you view the source to Tooling, does the Tooling(IDbConnection)
constructor use DbLinq.Sqlite.SqliteVendor?

3. What is the full stack trace to the error?

Thanks,
- Jon

Aaron Peterson

unread,
Oct 27, 2009, 10:47:37 PM10/27/09
to DbLinq
1. Version is 0.18

2. This is where I think I went wrong. I built the Tooling.cs file
after the file in the sqlite example folder.

can someone provide me with a link that explains the command strings
for dbmetal?

Aaron

Jonathan Pryor

unread,
Oct 27, 2009, 11:25:26 PM10/27/09
to dbl...@googlegroups.com
Version 0.18 is ancient (though truth told, I couldn't tell you what
actually changed in DbLinq over the last year...except for all the bugs
I know I fixed, which may or may not have any bearing on what you're
seeing.)

If possible, please try trunk.

As for DbMetal, this _used_ to work at one point:

DbMetal.exe /namespace:nwind /code:Northwind.cs /pluralize
"/conn:Data Source=Northwind.db3" /provider:Sqlite

The above would generate a Tooling type (and all related entity types)
for you. That might work for you.

- Jon

Aaron Peterson

unread,
Oct 28, 2009, 11:17:19 AM10/28/09
to DbLinq
when I try this command with DbMetal :

DbMetal.exe /namespace:Tooling /code:Tooling.cs /pluralize "/conn:Data
Source=Tooling.db3" /provider:SQlite

it fails on me and I get:

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM
\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software
\Microsoft\Fus
ion!EnableLog].

Sorry for the noob step by step questions, but I really want to get
this to work.

Aaron

Jonathan Pryor

unread,
Oct 28, 2009, 12:00:08 PM10/28/09
to dbl...@googlegroups.com
On Wed, 2009-10-28 at 08:17 -0700, Aaron Peterson wrote:
> DbMetal.exe /namespace:Tooling /code:Tooling.cs /pluralize "/conn:Data
> Source=Tooling.db3" /provider:SQlite
>
> it fails on me and I get:
>
> WRN: Assembly binding logging is turned OFF.

That looks like a warning, though I don't know why you're getting this
message in the first place.

Is there any actual error output? Did Tooling.cs get created?

Thanks,
- Jon


Aaron Peterson

unread,
Oct 28, 2009, 1:40:01 PM10/28/09
to DbLinq
No. Tooline.cs did not get created.

I get a failure warning from windows, then I get this warning.

This is a simple database:
1 table "Sanders"
with 3 values : ID, Height, OverallDiam.

I am using the dbmetal from 09/13/2008.

Is there a newer version I should be using?

Aaron

Jonathan Pryor

unread,
Oct 28, 2009, 1:56:42 PM10/28/09
to dbl...@googlegroups.com
If possible, I would suggest building DbLinq from source, specifically
from trunk:

http://code.google.com/p/dblinq2007/source/checkout

Alternatively, you can wait for the 0.19 release, though I'm not
entirely sure when that will be available...

- Jon

Aaron Peterson

unread,
Oct 29, 2009, 3:36:24 PM10/29/09
to DbLinq
Ok. chekedk out and built a new copy of DbMetal

exe went from 92 kb to over 4 meg.

I still get the same error when running the previous command.

Is there any doccumentation on the format for commands in DbMetal?

Aaron
> > Aaron- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages