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 |
Kirsten M. Z. 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 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| | | | |
Goto Forum:
Current Time: Fri Apr 26 00:44:43 GMT 2024
Powered by FUDForum. Page generated in 0.03490 seconds
|