LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-298] Creating a view on a temporary table causes MDR catalog errors #574

Open dynamobi-build opened 12 years ago

dynamobi-build commented 12 years ago

[reporter="jouellette", created="Wed, 3 Oct 2007 11:49:26 -0500 (GMT-05:00)"] The error is InvalidObjectException - Object with MOFID no longer exists. Run this SQL twice in a row to reproduce the error, which occurs on the DROP SCHEMA command.

!set force true
drop schema ddlgen cascade;

CREATE SCHEMA ddlgen;

SET SCHEMA 'ddlgen';

CREATE GLOBAL TEMPORARY TABLE ddlgen.temptab(x char(3) primary key)
DESCRIPTION 'a temp table'
ON COMMIT DELETE ROWS;

CREATE VIEW v
DESCRIPTION 'a view' AS
SELECT * FROM ddlgen.temptab WHERE x IS NOT NULL;

--
Here's a stack dump:

SEVERE: Object with MOFID j:00000000000038EC no longer exists.
Oct 3, 2007 6:19:02 PM FarragoJdbcUtil newSqlException(ex)
FINER: THROW
javax.jmi.reflect.InvalidObjectException: Object with MOFID j:00000000000038EC no longer exists.
        at org.netbeans.mdr.handlers.BaseObjectHandler._getDelegate(BaseObjectHandler.java:353)
        at org.netbeans.mdr.handlers.InstanceHandler.getInstanceDelegate(InstanceHandler.java:48)
        at org.netbeans.mdr.handlers.InstanceHandler._handleGetR(InstanceHandler.java:103)
        at net.sf.farrago.fem.med.FemLocalIndex$Impl.getSpannedClass(Unknown Source)
        at net.sf.farrago.catalog.FarragoCatalogUtil.getIndexTable(FarragoCatalogUtil.java:170)
        at net.sf.farrago.db.FarragoDbSessionIndexMap.onCommit(FarragoDbSessionIndexMap.java:189)
        at net.sf.farrago.db.FarragoDbSession.commitImpl(FarragoDbSession.java:732)
        at net.sf.farrago.db.FarragoDbSession.executeDdl(FarragoDbSession.java:1182)
        at net.sf.farrago.db.FarragoDbSession.prepareImpl(FarragoDbSession.java:1066)
        at net.sf.farrago.db.FarragoDbSession.prepare(FarragoDbSession.java:946)

dynamobi-build commented 12 years ago

[author="jvs", created="Wed, 3 Oct 2007 23:51:38 -0500 (GMT-05:00)"] Nice. Actually, you don't even need the view...just run the select to instantiate the temp table, and you'll get the same error on drop.

dynamobi-build commented 12 years ago

[author="jvs", created="Sat, 6 Oct 2007 19:41:42 -0500 (GMT-05:00)"] After reviewing FarragoDbSessionIndexMap, a proper fix here isn't trivial, since the maps in different sessions all need to be updated as part of the drop. Either that, or the map code needs to be careful to check the repository to see if the object still exists. Either way, extra synchronization is implied. I probably won't fix this unless/until someone is actually using the temp table support.