You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Petr Chmelar (Created) (JIRA)" <ji...@apache.org> on 2012/03/27 03:01:36 UTC

[jira] [Created] (JENA-227) containsModel returns false, which is false

containsModel returns false, which is false
-------------------------------------------

                 Key: JENA-227
                 URL: https://issues.apache.org/jira/browse/JENA-227
             Project: Apache Jena
          Issue Type: Bug
          Components: RDB
         Environment: Linux 64, PostgreSQL
            Reporter: Petr Chmelar
            Priority: Minor


		    // load the the driver class
			Class.forName(modelDBdriver);
				
		    // create a database connection
		    dbconn = new DBConnection(modelDBURL, modelDBuserName, modelDBpassWord, modelDBengine);
		    // create a model maker with the given connection parameters
		    maker = ModelFactory.createModelRDBMaker(dbconn);
		    
		    // open a previously created named model
		    if (dbconn.containsModel(name)) {
		    	// this d
                        System.out.println("Great job, model "+ name +" found :)");
		    	model = ModelRDB.open(dbconn, name);
		    }
		    else System.out.println("It seems there is no model " + name);
		    
		    // well, I know, it is there...
		    model = ModelRDB.open(dbconn, name);
 		    model.write(System.out); // this is OK


some time before this, I run, but it did even before:
		    // WARNING: this is realy dangerous:
		    dbconn.cleanDB();
		    		    
		    // create a model maker with the given connection parameters
		    maker = ModelFactory.createModelRDBMaker(dbconn);
		    
		    model = ModelRDB.createModel(dbconn, name, properties);


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JENA-227) containsModel returns false, which is false

Posted by "Petr Chmelar (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239720#comment-13239720 ] 

Petr Chmelar commented on JENA-227:
-----------------------------------

Hi Andy,

thank you... I'll try to move to SDB. I thought, that RDB is the default option, because SDB is not integrated in both versions 2.6.4 (which I use because of WebProtege) and 2.7.

I used cleanDB() instead of recreating the database schema, because I always got:

Exception in thread "main" com.hp.hpl.jena.db.RDFRDBException: Internal error in driver while cleaning database
(org.postgresql.util.PSQLException: ERROR: table "jena_g1t0_reif" does not exist).
Database may be corrupted. Try cleanDB() again.
	at com.hp.hpl.jena.db.impl.DriverRDB.doCleanDB(DriverRDB.java:1025)
	at com.hp.hpl.jena.db.impl.DriverRDB.cleanDB(DriverRDB.java:984)
	at com.hp.hpl.jena.db.DBConnection.cleanDB(DBConnection.java:119)
                
> containsModel returns false, which is false
> -------------------------------------------
>
>                 Key: JENA-227
>                 URL: https://issues.apache.org/jira/browse/JENA-227
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: RDB
>         Environment: Linux 64, PostgreSQL
>            Reporter: Petr Chmelar
>            Priority: Minor
>
> 		    // load the the driver class
> 			Class.forName(modelDBdriver);
> 				
> 		    // create a database connection
> 		    dbconn = new DBConnection(modelDBURL, modelDBuserName, modelDBpassWord, modelDBengine);
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    // open a previously created named model
> 		    if (dbconn.containsModel(name)) {
> 		    	// this d
>                         System.out.println("Great job, model "+ name +" found :)");
> 		    	model = ModelRDB.open(dbconn, name);
> 		    }
> 		    else System.out.println("It seems there is no model " + name);
> 		    
> 		    // well, I know, it is there...
> 		    model = ModelRDB.open(dbconn, name);
>  		    model.write(System.out); // this is OK
> some time before this, I run, but it did even before:
> 		    // WARNING: this is realy dangerous:
> 		    dbconn.cleanDB();
> 		    		    
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    model = ModelRDB.createModel(dbconn, name, properties);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JENA-227) containsModel returns false, which is false

Posted by "Andy Seaborne (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242405#comment-13242405 ] 

Andy Seaborne commented on JENA-227:
------------------------------------

If I remember rightly, cleanDB wasn't perfect -- but I can't rmember the details (it being years since I used RDB).  Sometimes the only solution was to use the DB tools to drop the database.

I'll mark this as "won't fix" as we don't support RDB anymore.

                
> containsModel returns false, which is false
> -------------------------------------------
>
>                 Key: JENA-227
>                 URL: https://issues.apache.org/jira/browse/JENA-227
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: RDB
>         Environment: Linux 64, PostgreSQL
>            Reporter: Petr Chmelar
>            Priority: Minor
>
> 		    // load the the driver class
> 			Class.forName(modelDBdriver);
> 				
> 		    // create a database connection
> 		    dbconn = new DBConnection(modelDBURL, modelDBuserName, modelDBpassWord, modelDBengine);
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    // open a previously created named model
> 		    if (dbconn.containsModel(name)) {
> 		    	// this d
>                         System.out.println("Great job, model "+ name +" found :)");
> 		    	model = ModelRDB.open(dbconn, name);
> 		    }
> 		    else System.out.println("It seems there is no model " + name);
> 		    
> 		    // well, I know, it is there...
> 		    model = ModelRDB.open(dbconn, name);
>  		    model.write(System.out); // this is OK
> some time before this, I run, but it did even before:
> 		    // WARNING: this is realy dangerous:
> 		    dbconn.cleanDB();
> 		    		    
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    model = ModelRDB.createModel(dbconn, name, properties);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JENA-227) containsModel returns false, which is false

Posted by "Petr Chmelar (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239726#comment-13239726 ] 

Petr Chmelar commented on JENA-227:
-----------------------------------

Sorry, this is just for the completeness... when I'm not using cleanDB, just the ModelRDB.createModel(dbconn, name, properties), which should recreate the database I get:

Exception in thread "main" com.hp.hpl.jena.shared.JenaException: Exception during database access
	at com.hp.hpl.jena.db.impl.PSet_TripleStore_RDB.find(PSet_TripleStore_RDB.java:876)
	at com.hp.hpl.jena.db.impl.SpecializedGraph_TripleStore.find(SpecializedGraph_TripleStore.java:142)
	at com.hp.hpl.jena.db.impl.SpecializedGraphBase.find(SpecializedGraphBase.java:28)
	at com.hp.hpl.jena.db.impl.DBPropDatabase.findDBPropNode(DBPropDatabase.java:134)
	at com.hp.hpl.jena.db.impl.DBPropDatabase.<init>(DBPropDatabase.java:84)
	at com.hp.hpl.jena.db.impl.DriverRDB.getSystemSpecializedGraph(DriverRDB.java:330)
	at com.hp.hpl.jena.db.GraphRDB.<init>(GraphRDB.java:185)
	at com.hp.hpl.jena.db.ModelRDB.createModel(ModelRDB.java:158)
	at rdf.PersistentModel.create(PersistentModel.java:55)
	at rdf.CreateRDFS.main(CreateRDFS.java:52)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "jena_sys_stmt" does not exist
  Pozice: 35
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:381)
	at com.hp.hpl.jena.db.impl.SQLCache.executeSQL(SQLCache.java:720)
	at com.hp.hpl.jena.db.impl.PSet_TripleStore_RDB.find(PSet_TripleStore_RDB.java:870)
	... 9 more

However, I'm moving to SDB, thank you.
                
> containsModel returns false, which is false
> -------------------------------------------
>
>                 Key: JENA-227
>                 URL: https://issues.apache.org/jira/browse/JENA-227
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: RDB
>         Environment: Linux 64, PostgreSQL
>            Reporter: Petr Chmelar
>            Priority: Minor
>
> 		    // load the the driver class
> 			Class.forName(modelDBdriver);
> 				
> 		    // create a database connection
> 		    dbconn = new DBConnection(modelDBURL, modelDBuserName, modelDBpassWord, modelDBengine);
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    // open a previously created named model
> 		    if (dbconn.containsModel(name)) {
> 		    	// this d
>                         System.out.println("Great job, model "+ name +" found :)");
> 		    	model = ModelRDB.open(dbconn, name);
> 		    }
> 		    else System.out.println("It seems there is no model " + name);
> 		    
> 		    // well, I know, it is there...
> 		    model = ModelRDB.open(dbconn, name);
>  		    model.write(System.out); // this is OK
> some time before this, I run, but it did even before:
> 		    // WARNING: this is realy dangerous:
> 		    dbconn.cleanDB();
> 		    		    
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    model = ModelRDB.createModel(dbconn, name, properties);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (JENA-227) containsModel returns false, which is false

Posted by "Andy Seaborne (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JENA-227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne closed JENA-227.
------------------------------

    
> containsModel returns false, which is false
> -------------------------------------------
>
>                 Key: JENA-227
>                 URL: https://issues.apache.org/jira/browse/JENA-227
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: RDB
>         Environment: Linux 64, PostgreSQL
>            Reporter: Petr Chmelar
>            Priority: Minor
>
> 		    // load the the driver class
> 			Class.forName(modelDBdriver);
> 				
> 		    // create a database connection
> 		    dbconn = new DBConnection(modelDBURL, modelDBuserName, modelDBpassWord, modelDBengine);
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    // open a previously created named model
> 		    if (dbconn.containsModel(name)) {
> 		    	// this d
>                         System.out.println("Great job, model "+ name +" found :)");
> 		    	model = ModelRDB.open(dbconn, name);
> 		    }
> 		    else System.out.println("It seems there is no model " + name);
> 		    
> 		    // well, I know, it is there...
> 		    model = ModelRDB.open(dbconn, name);
>  		    model.write(System.out); // this is OK
> some time before this, I run, but it did even before:
> 		    // WARNING: this is realy dangerous:
> 		    dbconn.cleanDB();
> 		    		    
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    model = ModelRDB.createModel(dbconn, name, properties);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (JENA-227) containsModel returns false, which is false

Posted by "Andy Seaborne (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JENA-227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne resolved JENA-227.
--------------------------------

    Resolution: Won't Fix

We do not support he RDB dtaabase layer anymore - it's been removed from 
Jena.
                
> containsModel returns false, which is false
> -------------------------------------------
>
>                 Key: JENA-227
>                 URL: https://issues.apache.org/jira/browse/JENA-227
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: RDB
>         Environment: Linux 64, PostgreSQL
>            Reporter: Petr Chmelar
>            Priority: Minor
>
> 		    // load the the driver class
> 			Class.forName(modelDBdriver);
> 				
> 		    // create a database connection
> 		    dbconn = new DBConnection(modelDBURL, modelDBuserName, modelDBpassWord, modelDBengine);
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    // open a previously created named model
> 		    if (dbconn.containsModel(name)) {
> 		    	// this d
>                         System.out.println("Great job, model "+ name +" found :)");
> 		    	model = ModelRDB.open(dbconn, name);
> 		    }
> 		    else System.out.println("It seems there is no model " + name);
> 		    
> 		    // well, I know, it is there...
> 		    model = ModelRDB.open(dbconn, name);
>  		    model.write(System.out); // this is OK
> some time before this, I run, but it did even before:
> 		    // WARNING: this is realy dangerous:
> 		    dbconn.cleanDB();
> 		    		    
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    model = ModelRDB.createModel(dbconn, name, properties);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JENA-227) containsModel returns false, which is false

Posted by "Andy Seaborne (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239292#comment-13239292 ] 

Andy Seaborne commented on JENA-227:
------------------------------------

Hi there - the RDB subsystem of Jena has been deprecated for some time in favor of SDB (for SQLdatabases) and TDB (for better scale and performance).  RDB has been removed from Jena in the 2.7.0 Apache release.     Which version of Jena are you running?

Re: dbconn.cleanDB(); 

You can do a complete clean of the database by dropping the database and recreating it.  While cleanDB tries to provide a database-independent way to reset state, it was not perfect.
                
> containsModel returns false, which is false
> -------------------------------------------
>
>                 Key: JENA-227
>                 URL: https://issues.apache.org/jira/browse/JENA-227
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: RDB
>         Environment: Linux 64, PostgreSQL
>            Reporter: Petr Chmelar
>            Priority: Minor
>
> 		    // load the the driver class
> 			Class.forName(modelDBdriver);
> 				
> 		    // create a database connection
> 		    dbconn = new DBConnection(modelDBURL, modelDBuserName, modelDBpassWord, modelDBengine);
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    // open a previously created named model
> 		    if (dbconn.containsModel(name)) {
> 		    	// this d
>                         System.out.println("Great job, model "+ name +" found :)");
> 		    	model = ModelRDB.open(dbconn, name);
> 		    }
> 		    else System.out.println("It seems there is no model " + name);
> 		    
> 		    // well, I know, it is there...
> 		    model = ModelRDB.open(dbconn, name);
>  		    model.write(System.out); // this is OK
> some time before this, I run, but it did even before:
> 		    // WARNING: this is realy dangerous:
> 		    dbconn.cleanDB();
> 		    		    
> 		    // create a model maker with the given connection parameters
> 		    maker = ModelFactory.createModelRDBMaker(dbconn);
> 		    
> 		    model = ModelRDB.createModel(dbconn, name, properties);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira