Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Derby - Table/View 'CDO_PROPERTIES' does not exist
[CDO] Derby - Table/View 'CDO_PROPERTIES' does not exist [message #1019058] Fri, 15 March 2013 00:40 Go to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
I used MySQL for my CDO repositories before. Everything worked well. However, I want to test Derby now. I changed my server code as follows:

EmbeddedDataSource dataSource = new EmbeddedDataSource();
dataSource.setDatabaseName(connectionData.getDbName());
dataSource.setCreateDatabase("create");
		
IStore store = CDODBUtil.createStore(
				CDODBUtil.createHorizontalMappingStrategy(true),
				new EmbeddedDerbyAdapter(),
				DBUtil.createConnectionProvider(dataSource));

repository = CDOServerUtil.createRepository(
		connectionData.getRepositoryName(), store,
		new HashMap<String, String>());
CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
//...


When the repository is added, CDO/Net4j reports the following exception:

java.sql.SQLSyntaxErrorException: Table/View 'CDO_PROPERTIES' does not exist.


The DB has been created. When I check the DB, I cannot find any table inside. Did I miss something very important? As I said, using the MySQL Adapter the code above was sufficient and everything worked.

I use

CDO Model Repository SDK	 4.2.0.v20130312-0827
Net4j DB Framework Derby Adapter 4.2.0.v20130116-0901  (however, the filename states org.eclipse.net4j.db.derby_4.1.0.v20130116-0901.jar)


I should also reference this topic, which reports the same problem. However, I cannot find a solution there (except using H2):
http://www.eclipse.org/forums/index.php/mv/msg/451546/

Thanks in advance!
Re: [CDO] Derby - Table/View 'CDO_PROPERTIES' does not exist [message #1019145 is a reply to message #1019058] Fri, 15 March 2013 05:45 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 15.03.2013 01:40, schrieb Kirsten M. Z.:
> I used MySQL for my CDO repositories before. Everything worked well. However, I want to test Derby now.
I normally recommend to try out H2 instead because it's slimmer and much faster. And it's the DB we test each build with.

> I changed my server code as follows:
>
> EmbeddedDataSource dataSource = new EmbeddedDataSource();
> dataSource.setDatabaseName(connectionData.getDbName());
> dataSource.setCreateDatabase("create");
>
> IStore store = CDODBUtil.createStore(
> CDODBUtil.createHorizontalMappingStrategy(true),
> new EmbeddedDerbyAdapter(),
> DBUtil.createConnectionProvider(dataSource));
>
> repository = CDOServerUtil.createRepository(
> connectionData.getRepositoryName(), store,
> new HashMap<String, String>());
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
That all looks ok.

> //...
>
> When the repository is added, CDO/Net4j reports the following exception:
>
> java.sql.SQLSyntaxErrorException: Table/View 'CDO_PROPERTIES' does not exist.
I suspect that something in your model is not supported by EmbeddedDerbyAdapter. Is there additional trace info in the
log? In standalone mode you can call this to enable logging and tracing:

// Enable logging and tracing
OMPlatform.INSTANCE.setDebugging(true);
OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);

Just this week I've finished a major rehaul of the Net4j DB framework and CDO's DBStore to make the schema handling more
stable and flexible:

[401763] Make CDO Server more robust against data dictionary changes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401763

You may want to try out the newest I-build to test it.

> The DB has been created. When I check the DB, I cannot find any table inside. Did I miss something very important? As
> I said, using the MySQL Adapter the code above was sufficient and everything worked.
>
> I use
> CDO Model Repository SDK 4.2.0.v20130312-0827
Okay, that's the newest I-build.

> Net4j DB Framework Derby Adapter 4.2.0.v20130116-0901 (however, the filename states
> org.eclipse.net4j.db.derby_4.1.0.v20130116-0901.jar)
That's okay. The build qualifier is made of the timestamp of the latest modification in the plugin, i.e., it doesn't
change with each build unless there's actual change.

> I should also reference this topic, which reports the same problem. However, I cannot find a solution there (except
> using H2):
> http://www.eclipse.org/forums/index.php/mv/msg/451546/
Yes, that sounds similar. But I need to see the exception that's traced in org.eclipse.net4j.spi.db.DBAdapter:

public boolean createTable(IDBTable table, Statement statement) throws DBException
{
boolean created = true;

try
{
doCreateTable(table, statement);
}
catch (SQLException ex)
{
created = false;
if (TRACER.isEnabled())
{
TRACER.trace("-- " + ex.getMessage()); //$NON-NLS-1$
}
}

validateTable(table, statement);
return created;
}

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Derby - Table/View 'CDO_PROPERTIES' does not exist [message #1019222 is a reply to message #1019145] Fri, 15 March 2013 09:09 Go to previous messageGo to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
I added the code for enabling debug tracing, but cannot see any change in the output.

I also set a breakpoint in the methode you mentioned:
public boolean createTable(IDBTable table, Statement statement) throws DBException


The method is not called, so there is also no error.
Re: [CDO] Derby - Table/View 'CDO_PROPERTIES' does not exist [message #1019239 is a reply to message #1019145] Fri, 15 March 2013 09:46 Go to previous messageGo to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
I tested H2 as you said now. I haven't known that H2 is also a Java DB engine. Works fine and also has all required features.

So I guess... Derby support is simply broken right now. However, H2 is a nice alternative, at least for me.

Thanks Eike!
Re: [CDO] Derby - Table/View 'CDO_PROPERTIES' does not exist [message #1019292 is a reply to message #1019239] Fri, 15 March 2013 11:39 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 15.03.2013 10:46, schrieb Kirsten M. Z.:
> I tested H2 as you said now. I haven't known that H2 is also a Java DB engine. Works fine and also has all required
> features.
>
> So I guess... Derby support is simply broken right now. However, H2 is a nice alternative, at least for me.
Great to hear that ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Derby - Table/View 'CDO_PROPERTIES' does not exist [message #1019328 is a reply to message #1019222] Fri, 15 March 2013 13:03 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 15-03-13 10:09, Kirsten M. Z. wrote:
> I added the code for enabling debug tracing, but cannot see any change
> in the output.

http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#How_can_I_enable_tracing.3F
>
> I also set a breakpoint in the methode you mentioned:
> public boolean createTable(IDBTable table, Statement statement) throws
> DBException
>
> The method is not called, so there is also no error.
Previous Topic:Command on Tree Editor
Next Topic:How to manage mixed XSD/XML resource?
Goto Forum:
  


Current Time: Fri Apr 26 20:22:23 GMT 2024

Powered by FUDForum. Page generated in 0.03144 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top