Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Schema Locked Exception after update to CDO 4.4
[CDO] Schema Locked Exception after update to CDO 4.4 [message #1701477] Mon, 13 July 2015 15:14 Go to next message
Samuel Leisering is currently offline Samuel LeiseringFriend
Messages: 34
Registered: July 2014
Member
Hi

after updating to CDO 4.4 i get a Schema locked exception (see below). This happens as soon as i try to commit a new EMF-model to the server (even with a "fresh" server and repository).
I'm using the Derby embedded DBStore with a Security Manager, audits enabled and ensureReferentialIntegrity enabled.

H2 does not work either.

The Exception:
org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore: org.eclipse.net4j.db.DBException: Schema locked: SCHEMA_NAME
	at org.eclipse.net4j.internal.db.ddl.DBSchema.assertUnlocked(DBSchema.java:278)
	at org.eclipse.net4j.internal.db.ddl.DBTable.assertUnlocked(DBTable.java:340)
	at org.eclipse.net4j.internal.db.ddl.DBTable.addField(DBTable.java:104)
	at org.eclipse.net4j.internal.db.ddl.DBTable.addField(DBTable.java:89)
	at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.createDBField(AbstractTypeMapping.java:162)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.initFields(AbstractHorizontalClassMapping.java:197)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.<init>(AbstractHorizontalClassMapping.java:107)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.<init>(HorizontalBranchingClassMapping.java:205)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingMappingStrategy.doCreateClassMapping(HorizontalBranchingMappingStrategy.java:62)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createClassMapping(AbstractMappingStrategy.java:659)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapClasses(AbstractMappingStrategy.java:651)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageInfos(AbstractMappingStrategy.java:627)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageUnits(AbstractMappingStrategy.java:616)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createMapping(AbstractMappingStrategy.java:538)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalMappingStrategy.createMapping(HorizontalMappingStrategy.java:144)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:849)
	at org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:81)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.doWrite(DBStoreAccessor.java:828)
	at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:152)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:651)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:48)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
	at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
	at org.eclipse.emf.cdo.internal.server.Repository.commitUnsynced(Repository.java:1133)
	at org.eclipse.emf.cdo.internal.server.Repository.commit(Repository.java:1126)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:320)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:105)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:98)
	at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:100)
	at org.eclipse.net4j.signal.Signal.doInput(Signal.java:330)
	at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:73)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:67)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:254)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Re: [CDO] Schema Locked Exception after update to CDO 4.4 [message #1701544 is a reply to message #1701477] Tue, 14 July 2015 05:14 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 13.07.2015 um 17:14 schrieb Samuel Leisering:
> Hi
>
> after updating to CDO 4.4 i get a Schema locked exception (see below).
We haven't changed much in cdo.server.db or net4j.db since 4.3.0. I've checked all respective commits and couldn't see
anything that could cause what you describe. From what version did you update to 4.4?

> This happens as soon as i try to commit a new EMF-model to the server (even with a "fresh" server and repository).
All our DB tests run against H2 and we've never seen that before, especially not with fresh repositories.

> I'm using the Derby embedded DBStore with a Security Manager, audits enabled and ensureReferentialIntegrity enabled.
Does the problem persist if you temporarily disable security and referential integrity checks?

>
> H2 does not work either.
You mean that the same exception is thrown?
What versions of Derby and H2 did you use?

>
> The Exception:
>
> org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore: org.eclipse.net4j.db.DBException: Schema locked:
> SCHEMA_NAME
Is your schema really named "SCHEMA_NAME "?

Cheers
/Eike

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


Re: [CDO] Schema Locked Exception after update to CDO 4.4 [message #1701792 is a reply to message #1701477] Wed, 15 July 2015 15:56 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi Samuel,

This is the typical exception which occurs when you change your
metamodel and the models stored in CDO repo haven't been migrated.

Best Regards.

Le 13/07/2015 17:14, Samuel Leisering a écrit :
> Hi
>
> after updating to CDO 4.4 i get a Schema locked exception (see below).
> This happens as soon as i try to commit a new EMF-model to the server
> (even with a "fresh" server and repository).
> I'm using the Derby embedded DBStore with a Security Manager, audits
> enabled and ensureReferentialIntegrity enabled.
>
> H2 does not work either.
>
> The Exception:
>
> org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore:
> org.eclipse.net4j.db.DBException: Schema locked: SCHEMA_NAME
> at
> org.eclipse.net4j.internal.db.ddl.DBSchema.assertUnlocked(DBSchema.java:278)
>
> at
> org.eclipse.net4j.internal.db.ddl.DBTable.assertUnlocked(DBTable.java:340)
> at
> org.eclipse.net4j.internal.db.ddl.DBTable.addField(DBTable.java:104)
> at org.eclipse.net4j.internal.db.ddl.DBTable.addField(DBTable.java:89)
> at
> org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.createDBField(AbstractTypeMapping.java:162)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.initFields(AbstractHorizontalClassMapping.java:197)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.<init>(AbstractHorizontalClassMapping.java:107)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.<init>(HorizontalBranchingClassMapping.java:205)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingMappingStrategy.doCreateClassMapping(HorizontalBranchingMappingStrategy.java:62)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createClassMapping(AbstractMappingStrategy.java:659)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapClasses(AbstractMappingStrategy.java:651)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageInfos(AbstractMappingStrategy.java:627)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageUnits(AbstractMappingStrategy.java:616)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createMapping(AbstractMappingStrategy.java:538)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalMappingStrategy.createMapping(HorizontalMappingStrategy.java:144)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:849)
>
> at
> org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:81)
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.doWrite(DBStoreAccessor.java:828)
>
> at
> org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:152)
>
> at
> org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:651)
>
> at
> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:48)
>
> at
> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.commitUnsynced(Repository.java:1133)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.commit(Repository.java:1126)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:320)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:105)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:98)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:100)
>
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:330)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:73)
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:67)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:254)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>



--
Esteban Dugueperoux - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: [CDO] Schema Locked Exception after update to CDO 4.4 [message #1705247 is a reply to message #1701792] Thu, 13 August 2015 09:29 Go to previous messageGo to next message
Samuel Leisering is currently offline Samuel LeiseringFriend
Messages: 34
Registered: July 2014
Member
Hi
@Eike:
I'm using derby version 10.8.2.2 with the net4j.db.derby version 4.1.200
for H2 i'm using org.h2 with version 1.3.168 and net4j.db.h2 version 4.2.200.

Both throw the same exception.
And no, my Schema is not named SCHEMA_NAME, i just changed it. The exception contains the correct name.

@Esteban:
Since i use a freshly generated database and server this shouldnt be the issue, because there are no CDO models stored in the repo.

Greetings,
Samuel

Re: [CDO] Schema Locked Exception after update to CDO 4.4 [message #1705926 is a reply to message #1705247] Thu, 20 August 2015 07:54 Go to previous messageGo to next message
Samuel Leisering is currently offline Samuel LeiseringFriend
Messages: 34
Registered: July 2014
Member
Hi
I did some more testing.
The thing i did now was:
* Install a completely new Eclipse Mars with a target platform containing the mars repo (to ensure that the latest released version is used)
* create a new cdo server product containing the necessary plugins
* create a cdo-server.xml that defines nothing but the repository name and the database connection (currently H2)
* start the server (which generates a completely fresh database)
* start the emf.Editor Application generated from our model
* connect to the server using the standard CDO Session view
* Add a new modelresource containing something from our model.

While committing the last step the exception still happens.

Another thing to note is that our model references another model which is also commited automatically in the last step.

Greetings,
Samuel
Re: [CDO] Schema Locked Exception after update to CDO 4.4 [message #1710666 is a reply to message #1705926] Thu, 08 October 2015 09:24 Go to previous messageGo to next message
Samuel Leisering is currently offline Samuel LeiseringFriend
Messages: 34
Registered: July 2014
Member
I got it:
My Model contained a class called "Annotation". It seems that there is another class named Annotation in one of the default models.

The DBStore Mapping tries to add the columns of my class to the already existing ANNOTATION-Table , which causes the schema-locked Exception.

The same constellation worked on CDO 4.3.
Is this a bug or the intended behaviour?
Re: [CDO] Schema Locked Exception after update to CDO 4.4 [message #1710672 is a reply to message #1710666] Thu, 08 October 2015 10:04 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 08.10.2015 um 11:24 schrieb Samuel Leisering:
> I got it:
> My Model contained a class called "Annotation". It seems that there is another class named Annotation in one of the
> default models.
>
> The DBStore Mapping tries to add the columns of my class to the already existing ANNOTATION-Table , which causes the
> schema-locked Exception.
>
> The same constellation worked on CDO 4.3. Is this a bug or the intended behaviour?
I would say it's desirable behavior ;-)

Note that you should probably also make use of the "qualifiedNames" property:
http://download.eclipse.org/modeling/emf/cdo/drops/R20150916-0434/help/org.eclipse.emf.cdo.doc/html/operators/Doc01_ConfiguringRepositories.html#Property_qualifiedNames

Cheers
/Eike

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


Re: [CDO] Schema Locked Exception after update to CDO 4.4 [message #1818157 is a reply to message #1701477] Mon, 09 December 2019 07:19 Go to previous message
Surashree Paul Choudhury is currently offline Surashree Paul ChoudhuryFriend
Messages: 1
Registered: December 2019
Junior Member
Hi,

We recently upgraded from CDO 3.0.1 to 4.7.0. Dependencies like EMF and NET4j upgraded too . Application uses postgres 9.1 database.

But on deployment below exception was encountered.

Caused by: org.postgresql.util.PSQLException: ERROR: relation "cdo_lobs" does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2077)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1810)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:498)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:372)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:364)
at org.eclipse.emf.cdo.server.internal.db.DBStore$3.migrateSchema(DBStore.java:1054)
at org.eclipse.emf.cdo.server.internal.db.DBStore.migrateSchema(DBStore.java:983)
at org.eclipse.emf.cdo.server.internal.db.DBStore.doActivate(DBStore.java:647)
at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76)
... 78 more

Noticed CDO v4 has a bunch of new table added, and this exception occurs while trying to rename a column from size to lsize.
I resolved the error temporarily by creating the table cdo_lobs manually.
However encountered a different exception :

caused by: org.eclipse.net4j.db.DBException: Schema locked: FUSIONREGISTER
at org.eclipse.net4j.internal.db.ddl.DBSchema.assertUnlocked(DBSchema.java:279)
at org.eclipse.net4j.internal.db.ddl.DBSchema.addTable(DBSchema.java:193)
at com.mst.fusion.runtime.repository.internal.HorizontalContainerAuditClassMapping.initTable(HorizontalContainerAuditClassMapping.java:159)
at com.mst.fusion.runtime.repository.internal.HorizontalContainerAuditClassMapping.<init>(HorizontalContainerAuditClassMapping.java:123)
at com.mst.fusion.runtime.repository.internal.HorizontalContainerAuditMappingStrategy.doCreateClassMapping(HorizontalContainerAuditMappingStrategy.java:39)
at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createClassMapping(AbstractMappingStrategy.java:544)
at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.getClassMapping(AbstractMappingStrategy.java:593)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy.queryResources(AbstractHorizontalMappingStrategy.java:130)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.queryResources(DBStoreAccessor.java:346)
at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.readResourceID(StoreAccessorBase.java:201)
at org.eclipse.emf.cdo.internal.server.Repository.readRootResource(Repository.java:2293)
at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:2454)
at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76)
at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalActivate(ShareableLifecycle.java:43)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:127)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:117)
at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:285)
at com.mst.fusion.runtime.repository.FusionCdoRepository.initialise(FusionCdoRepository.java:778)
at com.mst.fusion.runtime.repository.FusionCdoRepository.start(FusionCdoRepository.java:465)
at com.mst.fusion.runtime.repository.FusionCdoRepository.start(FusionCdoRepository.java:439)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_41]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.6.0_41]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_41]
at java.lang.reflect.Method.invoke(Method.java:622)[:1.6.0_41]
at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[10:org.apache.aries.blueprint:0.3.0]
at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824)
at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:636)

Is there a solution to this problem?
Does re-generating the model classes from .ecore and genmodel file resolves the problem?
Kindly help.

Thanks,
Surashree
Previous Topic:[CDO] Correctly configuring timeouts
Next Topic:History of EMF
Goto Forum:
  


Current Time: Thu Apr 18 04:01:45 GMT 2024

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

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

Back to the top