Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread Problem with memory database
Thu, Jun 26 2008 6:02 AMPermanent Link

Heiko Knuettel
I have 2 databases, one phsysical named "database", one in-memory named "memory". When I
execute the following queries...

memory: create table mytable as select * from mytable where id=1 with data
database: update memory.mytable set id=2
database: insert into mytable select * from memory.mytable
memory: drop table mytable

...the applications hangs. In EDBManager, after a while I get an
ElevateDB Error #300 Cannot lock the catalog memory for write access

What to do ?

Heiko
Thu, Jun 26 2008 7:58 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Heiko

>memory: create table mytable as select * from mytable where id=1 with data
>database: update memory.mytable set id=2
>database: insert into mytable select * from memory.mytable
>memory: drop table mytable
>
>..the applications hangs. In EDBManager, after a while I get an
>ElevateDB Error #300 Cannot lock the catalog memory for write access

It could be the first line which I think should be

create table mytable as select * from database.mytable where id=1 with data

You need to qualify the table with the database when operating from a query component pointing to another database.

I don't know if the "mytable" was just to show us but if not I'd strongly advise using different table names or qualifying all references to tables with the database.

Roy Lambert [Team Elevate]
Thu, Jun 26 2008 8:13 AMPermanent Link

Heiko Knuettel
Roy

>>It could be the first line which I think should be
>>create table mytable as select * from database.mytable where id=1 with data

Ah, sorry, you are right. I did it this way, just mistyped it here.

>>I don't know if the "mytable" was just to show us but if not I'd strongly advise
>>using different table names or qualifying all references to tables with the database.

Why ? When the query has DatabaseName "memory", just typing mytable without qualifier
always means memory.mytable, or does it not ? If I only use qualifiers when accessing
tables from a different database than the one I have set as DatabaseName in the query,
what could go wrong ?

Heiko
Thu, Jun 26 2008 9:03 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Heiko


>Why ? When the query has DatabaseName "memory", just typing mytable without qualifier
>always means memory.mytable, or does it not ? If I only use qualifiers when accessing
>tables from a different database than the one I have set as DatabaseName in the query,
>what could go wrong ?

You are correct in what you say. The reason for my comment is that either way it prevents that sort of typo.

create table memtbl as select * from dsktbl where id=1 with data

or

create table memory.mytable as select * from database.mytable where id=1 with data

Both clearly show what should be happening.

But back to the question. If you step through in the debugger which query does it crash at?

Roy Lambert [Team Elevate]
Thu, Jun 26 2008 9:21 AMPermanent Link

Heiko Knuettel
Roy

>>If you step through in the debugger which query does it crash at?

The last one. It is reproducible in EDB Manager, as soon as you execute the drop table
statement, EDB-Manager hangs for about one minute, and then displays the above mentioned
error message.

Heiko
Thu, Jun 26 2008 9:44 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Heiko

>The last one. It is reproducible in EDB Manager

Unfortunately not here it isn't. I did get an error about not being able to get exclusive access to the table and had to shut the other tabs I had open to drop the temporary table I'd created but once I'd done that it was fine.

Obviously I can't try it with your tables so its not exact.

What I did was log onto the memory database, create & run the first sql, move to the disk database and run lines two and three, move back to the memory database and run line 4. At this point I had to close the other 3 sql windows and then it all worked.

Roy Lambert [Team Elevate]

Thu, Jun 26 2008 10:18 AMPermanent Link

Heiko Knuettel
Roy

I did the same as you, but used only one SQL window.

I tried now with a SQL window for each statement like you, and, as you said, got an "no
exclusive table access" error. I closed the other 3 windows, run line 4, and it hangs for
a minute, then "Error #300 Cannot lock the catalog memory for write access".
When I close the memory database, reopen it, select the table in the treeview and click on
"Drop table", I get the same error.
After that, even when I close the session and reopen it, and then try to open the memory
db, I get the error. Only by closing EDBManager I can access the memory DB again without
error.

I tried with 5 different tables, with only one and much rows affected - always the same.

Strange...
Thu, Jun 26 2008 10:21 AMPermanent Link

Heiko Knuettel
Roy

Ah, maybe....are you using a remote session ? I'm currently using a local session.

And - thanks for your effort !!

Heiko
Thu, Jun 26 2008 11:04 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Heiko


All local none remote.

Just to check I'm using build 2.

Is the table to big/confidential to zip up and post to the binaries so I can try it here?

Roy Lambert [Team Elevate]
Thu, Jun 26 2008 11:04 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Heiko,

<< ..the applications hangs. In EDBManager, after a while I get an ElevateDB
Error #300 Cannot lock the catalog memory for write access >>

This may be related to an issue I found in B2 regarding references to
databases other than the current database.  It might be possible that the
catalog is left open when it shouldn't be, thus causing this issue.

Could you send me something that reproduces what you're seeing ?  I want to
test it with the current code to make sure that we're looking at the same
issue.

--
Tim Young
Elevate Software
www.elevatesoft.com

Page 1 of 2Next Page »
Jump to Page:  1 2
Image