Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDO server with oracle 11g db server(Packages no longer loaded to the server but otherwise working)
[CDO] CDO server with oracle 11g db server [message #930000] Mon, 01 October 2012 20:15 Go to next message
Warwick Burrows is currently offline Warwick Burrows
Messages: 84
Registered: July 2009
Location: Austin, TX
Member
Hi,

Today I've been trying to configure my CDO server against an oracle 11g server. It has been working correctly up to now using an oracle db store with a 10g client against a 10g oracle server. Against 11g the CDO server starts and it creates the CDO server internal tables but when I put my model packages to the server its not registering the package and its not creating the tables in the 11g db as it did for the 10g db. Its also not returning an error. I'm doing this to register the packages:

session = sessionConfiguration.openNet4jSession();
session.getPackageRegistry().putEPackage(MapmodelPackage.eINSTANCE);

I don't see any error in the server log. Has anyone deployed a CDO server with the oracle db store against an 11g server? Or should I be doing something else to register the packages?

Thanks,
Warwick
Re: [CDO] CDO server with oracle 11g db server [message #930255 is a reply to message #930000] Tue, 02 October 2012 02:32 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5153
Registered: July 2009
Senior Member
Hi Warwick,

Are you sure that only the database and the driver have changed in your deployment?

Please note that the OracleAdapter has not been developed by the CDO team. I suspect you've taken it from:

270428: [DB] Provide Oracle RDBMS integration
https://bugs.eclipse.org/bugs/show_bug.cgi?id=270428

This bug has quite some CCs. Maybe one of those folks can help?

Cheers
/Eike

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


Am 02.10.2012 02:15, schrieb Warwick Burrows:
> Hi,
>
> Today I've been trying to configure my CDO server against an oracle 11g server. It has been working correctly up to
> now using an oracle db store with a 10g client against a 10g oracle server. Against 11g the CDO server starts and it
> creates the CDO server internal tables but when I put my model packages to the server its not registering the package
> and its not creating the tables in the 11g db as it did for the 10g db. Its also not returning an error. I'm doing
> this to register the packages:
>
> session = sessionConfiguration.openNet4jSession();
> session.getPackageRegistry().putEPackage(MapmodelPackage.eINSTANCE);
>
> I don't see any error in the server log. Has anyone deployed a CDO server with the oracle db store against an 11g
> server? Or should I be doing something else to register the packages?
>
> Thanks,
> Warwick
>
Re: [CDO] CDO server with oracle 11g db server [message #930325 is a reply to message #930255] Tue, 02 October 2012 03:56 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 620
Registered: July 2009
Senior Member
I remember I have successfully tested the adapter against an 11g, too.
Re: [CDO] CDO server with oracle 11g db server [message #930802 is a reply to message #930325] Tue, 02 October 2012 12:55 Go to previous messageGo to next message
Warwick Burrows is currently offline Warwick Burrows
Messages: 84
Registered: July 2009
Location: Austin, TX
Member
Thanks Erdal. Did you have any issues running a 10g client with an 11g server that might require db store configuration changes or an update to the driver? There are no errors in the server logs so I'm not sure what the problem might be. I'm going to try connecting with the debugger next.

And yes Eike, I'm using the driver from the bugzilla that Erdal worked on and it has been working fine with 10g client and server. But as you suspect its not the only thing I've changed. I have updated my model adding new classes and fields so the model isn't exactly the same as the one I was using previously. So let me know if there are any model related issues that might account for this. The validation of the model in the ecore editor and code generation from the model were both successful.
Re: [CDO] CDO server with oracle 11g db server [message #930817 is a reply to message #930802] Tue, 02 October 2012 13:08 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5153
Registered: July 2009
Senior Member
Am 02.10.2012 18:55, schrieb Warwick Burrows:
> Thanks Erdal. Did you have any issues running a 10g client with an 11g server that might require db store
> configuration changes or an update to the driver? There are no errors in the server logs so I'm not sure what the
> problem might be. I'm going to try connecting with the debugger next.
>
> And yes Eike, I'm using the driver from the bugzilla that Erdal worked on and it has been working fine with 10g client
> and server. But as you suspect its not the only thing I've changed. I have updated my model adding new classes and
> fields so the model isn't exactly the same as the one I was using previously. So let me know if there are any model
> related issues that might account for this. The validation of the model in the ecore editor and code generation from
> the model were both successful.
Model evolution (i.e. automatic instance migration) is not yet supported by CDO. So that can't work. Please search this
forum for the term "evolution" to find some hints about how to deal with the situation.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] CDO server with oracle 11g db server [message #930822 is a reply to message #930817] Tue, 02 October 2012 13:15 Go to previous messageGo to next message
Warwick Burrows is currently offline Warwick Burrows
Messages: 84
Registered: July 2009
Location: Austin, TX
Member
Sorry I should have been more clear. This is a fresh db schema with no tables at all. Now automatic table creation based on the model is supported though isn't it? I've seen this work myself last time I dropped the schema and restarted my application? The model tables were automatically created for me.
Re: [CDO] CDO server with oracle 11g db server [message #930827 is a reply to message #930822] Tue, 02 October 2012 13:19 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5153
Registered: July 2009
Senior Member
Am 02.10.2012 19:15, schrieb Warwick Burrows:
> Sorry I should have been more clear. This is a fresh db schema with no tables at all. Now automatic table creation
> based on the model is supported though isn't it? I've seen this work myself last time I dropped the schema and
> restarted my application? The model tables were automatically created for me.
That was a misunderstanding. Yes, that should work as always.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] CDO server with oracle 11g db server [message #930941 is a reply to message #930827] Tue, 02 October 2012 15:38 Go to previous messageGo to next message
Warwick Burrows is currently offline Warwick Burrows
Messages: 84
Registered: July 2009
Location: Austin, TX
Member
What's the trigger for the model tables to get created on the server side? As noted earlier I'm doing this to register the packages from my client app:

session = sessionConfiguration.openNet4jSession();
session.getPackageRegistry().putEPackage(MapmodelPackage.eINSTANCE);

When I step through this code I see it putting the package to the registry but what condition triggers the server to then add the package to its own registry?
Re: [CDO] CDO server with oracle 11g db server [message #930946 is a reply to message #930802] Tue, 02 October 2012 15:42 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 620
Registered: July 2009
Senior Member
The ojdbc14.jar driver should also work for a 11g db.

Found this stack overflow post which tells about minor DATE 'incompatibilities':
http://stackoverflow.com/questions/4369660/can-we-use-ojdbc14-jar-with-oracel11g-and-jdk1-5

Do the tables for your new model still get generated against a 10g?

Warwick Burrows wrote on Tue, 02 October 2012 12:55
Thanks Erdal. Did you have any issues running a 10g client with an 11g server that might require db store configuration changes or an update to the driver? There are no errors in the server logs so I'm not sure what the problem might be. I'm going to try connecting with the debugger next.

And yes Eike, I'm using the driver from the bugzilla that Erdal worked on and it has been working fine with 10g client and server. But as you suspect its not the only thing I've changed. I have updated my model adding new classes and fields so the model isn't exactly the same as the one I was using previously. So let me know if there are any model related issues that might account for this. The validation of the model in the ecore editor and code generation from the model were both successful.

Re: [CDO] CDO server with oracle 11g db server [message #930961 is a reply to message #930946] Tue, 02 October 2012 16:00 Go to previous messageGo to next message
Warwick Burrows is currently offline Warwick Burrows
Messages: 84
Registered: July 2009
Location: Austin, TX
Member
Thanks for the information on 11g compatibility. To answer your question, I just tried with a clean oracle 10g schema and am having the same problem as with the 11g schema. So I guess its related to my model changes. Any suggestions on how to debug this given that package registration from the client side seems to be working and there's no errors in the server log?
Re: [CDO] CDO server with oracle 11g db server [message #930974 is a reply to message #930961] Tue, 02 October 2012 16:17 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 620
Registered: July 2009
Senior Member
I remember to have problems when using primitive data types 'not directly mapped by ecore', i.e. String instead of EString, Date instead of EDate... just a thought...

Did you try a more verbose log level on the server side?
Re: [CDO] CDO server with oracle 11g db server [message #931030 is a reply to message #930974] Tue, 02 October 2012 17:43 Go to previous messageGo to next message
Warwick Burrows is currently offline Warwick Burrows
Messages: 84
Registered: July 2009
Location: Austin, TX
Member
I found my problem! The issue is that I was running an OCL query against the server to determine whether an object exists before trying to create it. But it looks like the model tables aren't created in a clean schema until you've created and committed a new object. So I was getting "context missing" from OCL because I had thought that the schema should have been created when I submitted the packages. I changed my code to expect the exception and the schema was created when I committed my first object. Does anyone know if there's a way from the client to tell the server to create the schema immediately when the package is registered?

Re: [CDO] CDO server with oracle 11g db server [message #931328 is a reply to message #930941] Wed, 03 October 2012 01:15 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5153
Registered: July 2009
Senior Member
Am 02.10.2012 21:38, schrieb Warwick Burrows:
> What's the trigger for the model tables to get created on the server side? As noted earlier I'm doing this to
> register the packages from my client app:
>
> session = sessionConfiguration.openNet4jSession();
> session.getPackageRegistry().putEPackage(MapmodelPackage.eINSTANCE);
Calling putEPackage() is not needed anymore for generated (and globally registered) packages.

> When I step through this code I see it putting the package to the registry but what condition triggers the server to
> then add the package to its own registry?
New packages are automatically commit()'ed when needed, i.e., when the first new object from one of it's classes is
committed.

IIRC, with IRepository.setInitialPackages(EPackage...) you can force packages being "pre-mapped".

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] CDO server with oracle 11g db server [message #931334 is a reply to message #930946] Wed, 03 October 2012 01:19 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5153
Registered: July 2009
Senior Member
Am 02.10.2012 21:42, schrieb Erdal Karaca:
> The ojdbc14.jar driver should also work for a 11g db.
Is that jar already an OSGi bundle? Is it easy to download / how?

I'm asking because we could try to make Oracle support a first class option in CDO / Net4j DB, but only if I can
provision an Oracle driver *bundle* on hudson.eclipse.org without technical or legal problems.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] CDO server with oracle 11g db server [message #931339 is a reply to message #931030] Wed, 03 October 2012 01:23 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5153
Registered: July 2009
Senior Member
Am 02.10.2012 23:43, schrieb Warwick Burrows:
> I found my problem! The issue is that I was running an OCL query against the server to determine whether an object
> exists before trying to create it. But it looks like the model tables aren't created in a clean schema until you've
> created and committed a new object. So I was getting "context missing" from OCL because I had thought that the schema
> should have been created when I submitted the packages. I changed my code to expect the exception and the schema was
> created when I committed my first object. Does anyone know if there's a way from the client to tell the server to
> create the schema immediately when the package is registered?
Currently the only way from the client side is to commit an object. Can be a dummy object that's deleted in the next commit.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] CDO server with oracle 11g db server [message #931608 is a reply to message #931334] Wed, 03 October 2012 06:54 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 620
Registered: July 2009
Senior Member
Just had a look at ojdbc14.jar, ojdbc5.jar and ojdbc6.jar: no OSGi bundle headers present. That would be no problem to convert them to osgi bundles but not sure of the legal issues...

The license agreement:

http://www.oracle.com/technetwork/licenses/distribution-license-152002.html

Maybe, we could ask someone of the Eclipse Foundation to have a look at it?

Eike Stepper wrote on Wed, 03 October 2012 01:19
Am 02.10.2012 21:42, schrieb Erdal Karaca:
> The ojdbc14.jar driver should also work for a 11g db.
Is that jar already an OSGi bundle? Is it easy to download / how?

I'm asking because we could try to make Oracle support a first class option in CDO / Net4j DB, but only if I can
provision an Oracle driver *bundle* on hudson.eclipse.org without technical or legal problems.

Cheers
/Eike

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

Re: [CDO] CDO server with oracle 11g db server [message #931670 is a reply to message #931608] Wed, 03 October 2012 08:09 Go to previous message
Eike Stepper is currently offline Eike Stepper
Messages: 5153
Registered: July 2009
Senior Member
Am 03.10.2012 12:54, schrieb Erdal Karaca:
> Just had a look at ojdbc14.jar, ojdbc5.jar and ojdbc6.jar: no OSGi bundle headers present. That would be no problem to
> convert them to osgi bundles but not sure of the legal issues...
>
> The license agreement:
>
> http://www.oracle.com/technetwork/licenses/distribution-license-152002.html
>
> Maybe, we could ask someone of the Eclipse Foundation to have a look at it?
Okay, I'll try that way. They tried to get feedback from IBM because of the DB2 driver. No response after 6 notes. But
perhaps Oracle is friendlier ;-)

Cheers
/Eike

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


>
> Eike Stepper wrote on Wed, 03 October 2012 01:19
>> Am 02.10.2012 21:42, schrieb Erdal Karaca:
>> > The ojdbc14.jar driver should also work for a 11g db.
>> Is that jar already an OSGi bundle? Is it easy to download / how?
>>
>> I'm asking because we could try to make Oracle support a first class option in CDO / Net4j DB, but only if I can
>> provision an Oracle driver *bundle* on hudson.eclipse.org without technical or legal problems.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>
>
Previous Topic:[CDO] How to customize the length of a TABLE column in DBStore (H2) to avoid JdbcSQLException
Next Topic:Serialization order for attributes
Goto Forum:
  


Current Time: Wed May 22 16:01:27 EDT 2013

Powered by FUDForum. Page generated in 0.02510 seconds