Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO]Rollback in DBStore NullPointerException([CDO]Rollback in DBStore NullPointerException)
[CDO]Rollback in DBStore NullPointerException [message #990103] Mon, 10 December 2012 16:49 Go to next message
Andrew Whelan is currently offline Andrew Whelan
Messages: 69
Registered: October 2012
Location: Syracuse NY
Member
Hello.

I am trying to save an object that extends CDOObject to a database and am getting an exception that seems to be coming from the server. The server is talking to a MySQL database. The server is an instance of the org.eclipse.emf.cdo.server.product.tcp_h2 product using a cdo-server.xml with the following dbAdapter configuration:

<dbAdapter name="mysql"/>
<dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
url="jdbc:mysql://localhost:3306/repo1"
user="root"
password="password"/>
/>


It worked using the following tutorial (with a few minor changes): http://www.rcp-vision.com/?p=1285&lang=en.

This Server is being run from the IDE.

Note that this all happens the first time a database call is made so there is an empty database schema "repo1" when we start. When the following exception is thrown the CDO meta tables are created (auto created by the server) and some data is actually added to those tables but I'm pretty sure the CDO meta data never gets fully set. When I try to run the same code a second time I get a duplicate key exception.

Following is a dumbed down version of the client code, followed by the exception. I'm just wondering if this exception means anything to any of you? It looks like it's coming from the server end and I'm having a difficult time debugging this. Any help would be appreciated. Thanks

Andrew

PS: What is the significance of the string "/res1" in CDOResource resource = transaction
.getOrCreateResource("/res1") ????

CODE:

public class ReferenceTest {
	
	
private static CDOSession cdoSession;
    
	public static void init() {
		// The following lines are not needed if the extension
		// registry (OSGi/Equinox) is running
		
		Net4jUtil.prepareContainer(IPluginContainer.INSTANCE);
		TCPUtil.prepareContainer(IPluginContainer.INSTANCE);
		
		cdoSession = openSession("repo1");
		
	}
	
	public static CDOSession openSession(String repoName) {
		
	
		final IConnector connector = (IConnector) IPluginContainer.INSTANCE
				.getElement( //
						"org.eclipse.net4j.connectors", // Product group
						"tcp", // Type
						"localhost"); // Description
		CDOSessionConfiguration config = CDONet4jUtil
				.createSessionConfiguration();
		
		((CDONet4jSessionConfiguration) config).setConnector(connector);
		((CDONet4jSessionConfiguration) config).setRepositoryName(repoName);
		CDOSession session = config.openSession();
		
		
		session.addListener(new LifecycleEventAdapter() {
			@Override
			protected void onDeactivated(ILifecycle lifecycle) {
				connector.close();
			}
		});
		return session;
	}
	
    
    /**
     * Saves the List of EObjects to the specified URI. The URI must not be null.
     * 
     * @param uri
     * @param objects
     * @throws IOException
     */
    //public static void save(List<EObject> objects) throws IOException {
      	
	public static void save(EObject object) throws IOException {
    	try
    	{
    	      init();
		
		CDOTransaction transaction = cdoSession.openTransaction();
		
		CDOResource resource = transaction
				.getOrCreateResource("/res1");
		
	       resource.getContents().add(object);
		
		transaction.commit();
		cdoSession.close();
        } catch (CommitException e) {
		    e.printStackTrace();
	    } finally {
	    	if(cdoSession!=null){
		        cdoSession.close();
	    	}
	    }
    }
    
	public static void main(String [] args)
	{

	   java.lang.System.out.println("Starting");
	   
          //Designator extends an object that extends CDOObject
	   Designator d = ReferenceFactory.eINSTANCE.createDesignator();
	   
	   String valid = "Y";
	   d.getValid().add(valid);

          //Reference extends an object that extends CDOObject
	   Reference r = ReferenceFactory.eINSTANCE.createReference();
	   r.getDesignator().add(d);
	
	   try
	   {
	       save(d);
	   }
	   catch(Exception e)
	   {
		   e.printStackTrace();
	   }
	   System.out.println("End");
	   
	}
	
}

EXCEPTON (NOTE: The trace after the string "End" is client side)



Starting
org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore: java.lang.NullPointerException
at org.eclipse.emf.cdo.server.internal.db.mapping.CoreTypeMappings$TMEnum.getDefaultValue(CoreTypeMappings.java:87)
at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.setValue(AbstractTypeMapping.java:115)
at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.setValueFromRevision(AbstractTypeMapping.java:94)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.writeValues(HorizontalBranchingClassMapping.java:645)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.writeRevision(HorizontalBranchingClassMapping.java:842)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevision(DBStoreAccessor.java:584)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevisions(DBStoreAccessor.java:564)
at org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:94)
at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:149)
at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:487)
at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:43)
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.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:262)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:96)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:86)
at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:65)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
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)

End
at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:85)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1144)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1164)
at com.src.ewir.nighthawk.analysis.models.reference.test.ReferenceTest.save(ReferenceTest.java:91)
at com.src.ewir.nighthawk.analysis.models.reference.test.ReferenceTest.main(ReferenceTest.java:140)
Re: [CDO]Rollback in DBStore NullPointerException [message #990112 is a reply to message #990103] Mon, 10 December 2012 17:42 Go to previous messageGo to next message
Andrew Whelan is currently offline Andrew Whelan
Messages: 69
Registered: October 2012
Location: Syracuse NY
Member
The line of code
save(d);
Should be
save(r);
This was a debugging try that made no difference. The exception is still being thrown.

Again, any help is well appreciated!
Re: [CDO]Rollback in DBStore NullPointerException [message #990143 is a reply to message #990103] Tue, 11 December 2012 01:50 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5482
Registered: July 2009
Senior Member
Hi Andrew,

A customer of mine just reported the same exception. It's related to the default value of an EEnum-typed EAttribute. The
following EMF method is called: org.eclipse.emf.ecore.EEnum.getEEnumLiteralByLiteral(String) and to me it seems to
expect the text *literal* and not the integer (ordinal) value of the EEnumLiteral. Can you please double-check your meta
model and report here if changing it helps?

Cheers
/Eike

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



Am 10.12.2012 22:49, schrieb Andrew Whelan:
> Hello.
>
> I am trying to save an object that extends CDOObject to a database and am getting an exception that seems to be coming
> from the server. The server is talking to a MySQL database. The server is an instance of the
> org.eclipse.emf.cdo.server.product.tcp_h2 product using a cdo-server.xml with the following dbAdapter configuration:
>
> <dbAdapter name="mysql"/>
> <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
> url="jdbc:mysql://localhost:3306/repo1"
> user="root"
> password="password"/>
> />
>
>
> It worked using the following tutorial (with a few minor changes): http://www.rcp-vision.com/?p=1285&lang=en.
>
> This Server is being run from the IDE.
>
> Note that this all happens the first time a database call is made so there is an empty database schema "repo1" when we
> start. When the following exception is thrown the CDO meta tables are created (auto created by the server) and some
> data is actually added to those tables but I'm pretty sure the CDO meta data never gets fully set. When I try to run
> the same code a second time I get a duplicate key exception.
>
> Following is a dumbed down version of the client code, followed by the exception. I'm just wondering if this exception
> means anything to any of you? It looks like it's coming from the server end and I'm having a difficult time debugging
> this. Any help would be appreciated. Thanks
> Andrew
>
> PS: What is the significance of the string "/res1" in CDOResource resource = transaction
> .getOrCreateResource("/res1") ????
>
> CODE:
>
> public class ReferenceTest {
>
>
> private static CDOSession cdoSession;
> public static void init() {
> // The following lines are not needed if the extension
> // registry (OSGi/Equinox) is running
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE);
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE);
>
> cdoSession = openSession("repo1");
>
> }
>
> public static CDOSession openSession(String repoName) {
>
>
> final IConnector connector = (IConnector) IPluginContainer.INSTANCE
> .getElement( //
> "org.eclipse.net4j.connectors", // Product group
> "tcp", // Type
> "localhost"); // Description
> CDOSessionConfiguration config = CDONet4jUtil
> .createSessionConfiguration();
>
> ((CDONet4jSessionConfiguration) config).setConnector(connector);
> ((CDONet4jSessionConfiguration) config).setRepositoryName(repoName);
> CDOSession session = config.openSession();
>
>
> session.addListener(new LifecycleEventAdapter() {
> @Override
> protected void onDeactivated(ILifecycle lifecycle) {
> connector.close();
> }
> });
> return session;
> }
>
> /**
> * Saves the List of EObjects to the specified URI. The URI must not be null.
> * * @param uri
> * @param objects
> * @throws IOException
> */
> //public static void save(List<EObject> objects) throws IOException {
>
> public static void save(EObject object) throws IOException {
> try
> {
> init();
>
> CDOTransaction transaction = cdoSession.openTransaction();
>
> CDOResource resource = transaction
> .getOrCreateResource("/res1");
>
> resource.getContents().add(object);
>
> transaction.commit();
> cdoSession.close();
> } catch (CommitException e) {
> e.printStackTrace();
> } finally {
> if(cdoSession!=null){
> cdoSession.close();
> }
> }
> }
> public static void main(String [] args)
> {
>
> java.lang.System.out.println("Starting");
> //Designator extends an object that extends CDOObject
> Designator d = ReferenceFactory.eINSTANCE.createDesignator();
> String valid = "Y";
> d.getValid().add(valid);
>
> //Reference extends an object that extends CDOObject
> Reference r = ReferenceFactory.eINSTANCE.createReference();
> r.getDesignator().add(d);
>
> try
> {
> save(d);
> }
> catch(Exception e)
> {
> e.printStackTrace();
> }
> System.out.println("End");
> }
>
> }
> EXCEPTON (NOTE: The trace after the string "End" is client side)
>
>
> Starting
> org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore: java.lang.NullPointerException
> at org.eclipse.emf.cdo.server.internal.db.mapping.CoreTypeMappings$TMEnum.getDefaultValue(CoreTypeMappings.java:87)
> at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.setValue(AbstractTypeMapping.java:115)
> at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.setValueFromRevision(AbstractTypeMapping.java:94)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.writeValues(HorizontalBranchingClassMapping.java:645)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.writeRevision(HorizontalBranchingClassMapping.java:842)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevision(DBStoreAccessor.java:584)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevisions(DBStoreAccessor.java:564)
> at org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:94)
> at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:149)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:487)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:43)
> 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.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:262)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:96)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:86)
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:65)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
> 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)
>
> End
> at
> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:85)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1144)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1164)
> at com.src.ewir.nighthawk.analysis.models.reference.test.ReferenceTest.save(ReferenceTest.java:91)
> at com.src.ewir.nighthawk.analysis.models.reference.test.ReferenceTest.main(ReferenceTest.java:140)
>
Re: [CDO]Rollback in DBStore NullPointerException [message #990145 is a reply to message #990143] Tue, 11 December 2012 02:17 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5482
Registered: July 2009
Senior Member
Am 11.12.2012 07:50, schrieb Eike Stepper:
> Hi Andrew,
>
> A customer of mine just reported the same exception. It's related to the default value of an EEnum-typed EAttribute.
> The following EMF method is called: org.eclipse.emf.ecore.EEnum.getEEnumLiteralByLiteral(String) and to me it seems to
> expect the text *literal* and not the integer (ordinal) value of the EEnumLiteral. Can you please double-check your
> meta model and report here if changing it helps?

I found this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=335942

I strongly recommend that you comment on that bugzilla to show that it's worth to be fixed soon!

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
>
>
>
> Am 10.12.2012 22:49, schrieb Andrew Whelan:
>> Hello.
>>
>> I am trying to save an object that extends CDOObject to a database and am getting an exception that seems to be
>> coming from the server. The server is talking to a MySQL database. The server is an instance of the
>> org.eclipse.emf.cdo.server.product.tcp_h2 product using a cdo-server.xml with the following dbAdapter configuration:
>>
>> <dbAdapter name="mysql"/>
>> <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
>> url="jdbc:mysql://localhost:3306/repo1"
>> user="root"
>> password="password"/>
>> />
>>
>>
>> It worked using the following tutorial (with a few minor changes): http://www.rcp-vision.com/?p=1285&lang=en.
>>
>> This Server is being run from the IDE.
>>
>> Note that this all happens the first time a database call is made so there is an empty database schema "repo1" when
>> we start. When the following exception is thrown the CDO meta tables are created (auto created by the server) and
>> some data is actually added to those tables but I'm pretty sure the CDO meta data never gets fully set. When I try to
>> run the same code a second time I get a duplicate key exception.
>>
>> Following is a dumbed down version of the client code, followed by the exception. I'm just wondering if this
>> exception means anything to any of you? It looks like it's coming from the server end and I'm having a difficult time
>> debugging this. Any help would be appreciated. Thanks
>> Andrew
>>
>> PS: What is the significance of the string "/res1" in CDOResource resource = transaction
>> .getOrCreateResource("/res1") ????
>>
>> CODE:
>>
>> public class ReferenceTest {
>>
>>
>> private static CDOSession cdoSession;
>> public static void init() {
>> // The following lines are not needed if the extension
>> // registry (OSGi/Equinox) is running
>>
>> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE);
>> TCPUtil.prepareContainer(IPluginContainer.INSTANCE);
>>
>> cdoSession = openSession("repo1");
>>
>> }
>>
>> public static CDOSession openSession(String repoName) {
>>
>>
>> final IConnector connector = (IConnector) IPluginContainer.INSTANCE
>> .getElement( //
>> "org.eclipse.net4j.connectors", // Product group
>> "tcp", // Type
>> "localhost"); // Description
>> CDOSessionConfiguration config = CDONet4jUtil
>> .createSessionConfiguration();
>>
>> ((CDONet4jSessionConfiguration) config).setConnector(connector);
>> ((CDONet4jSessionConfiguration) config).setRepositoryName(repoName);
>> CDOSession session = config.openSession();
>>
>>
>> session.addListener(new LifecycleEventAdapter() {
>> @Override
>> protected void onDeactivated(ILifecycle lifecycle) {
>> connector.close();
>> }
>> });
>> return session;
>> }
>>
>> /**
>> * Saves the List of EObjects to the specified URI. The URI must not be null.
>> * * @param uri
>> * @param objects
>> * @throws IOException
>> */
>> //public static void save(List<EObject> objects) throws IOException {
>>
>> public static void save(EObject object) throws IOException {
>> try
>> {
>> init();
>>
>> CDOTransaction transaction = cdoSession.openTransaction();
>>
>> CDOResource resource = transaction
>> .getOrCreateResource("/res1");
>>
>> resource.getContents().add(object);
>>
>> transaction.commit();
>> cdoSession.close();
>> } catch (CommitException e) {
>> e.printStackTrace();
>> } finally {
>> if(cdoSession!=null){
>> cdoSession.close();
>> }
>> }
>> }
>> public static void main(String [] args)
>> {
>>
>> java.lang.System.out.println("Starting");
>> //Designator extends an object that extends CDOObject
>> Designator d = ReferenceFactory.eINSTANCE.createDesignator();
>> String valid = "Y";
>> d.getValid().add(valid);
>>
>> //Reference extends an object that extends CDOObject
>> Reference r = ReferenceFactory.eINSTANCE.createReference();
>> r.getDesignator().add(d);
>>
>> try
>> {
>> save(d);
>> }
>> catch(Exception e)
>> {
>> e.printStackTrace();
>> }
>> System.out.println("End");
>> }
>>
>> }
>> EXCEPTON (NOTE: The trace after the string "End" is client side)
>>
>>
>> Starting
>> org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore: java.lang.NullPointerException
>> at org.eclipse.emf.cdo.server.internal.db.mapping.CoreTypeMappings$TMEnum.getDefaultValue(CoreTypeMappings.java:87)
>> at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.setValue(AbstractTypeMapping.java:115)
>> at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.setValueFromRevision(AbstractTypeMapping.java:94)
>> at
>> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.writeValues(HorizontalBranchingClassMapping.java:645)
>> at
>> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.writeRevision(HorizontalBranchingClassMapping.java:842)
>> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevision(DBStoreAccessor.java:584)
>> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevisions(DBStoreAccessor.java:564)
>> at org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:94)
>> at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:149)
>> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:487)
>> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:43)
>> 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.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:262)
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:96)
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:86)
>> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
>> at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:65)
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>> 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)
>>
>> End
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:85)
>> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1144)
>> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1164)
>> at com.src.ewir.nighthawk.analysis.models.reference.test.ReferenceTest.save(ReferenceTest.java:91)
>> at com.src.ewir.nighthawk.analysis.models.reference.test.ReferenceTest.main(ReferenceTest.java:140)
>>
>
Re: [CDO]Rollback in DBStore NullPointerException [message #990342 is a reply to message #990143] Tue, 11 December 2012 18:47 Go to previous messageGo to next message
Andrew Whelan is currently offline Andrew Whelan
Messages: 69
Registered: October 2012
Location: Syracuse NY
Member
Eike,

I was able to make the offending Enum transient just for a test and was then able to save some data!

I'm not sure how I can change the meta model so the literal value is default instead of the ordinal (I think this is what you are asking me to do)?

Following is the XML snippet of the offending EEnum in the .core file. Is there an attribute I can add to do what you are asking? Or is it something I need to change in the code that is generated?

<eClassifiers xsi:type="ecore:EEnum" name="ValueType" serializable="false">
    <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
      <details key="documentation" value="Enumeration to specify the types of Values that can be attached to a property."/>
    </eAnnotations>
    <eLiterals name="VALUE" value="2">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="The current property holds a value"/>
      </eAnnotations>
    </eLiterals>
    <eLiterals name="NA">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="Means the current property is Not Applicable to the containing instance"/>
      </eAnnotations>
    </eLiterals>
    <eLiterals name="UNKNOWN" value="1">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="The current Property is unknown for the containing instance"/>
      </eAnnotations>
    </eLiterals>
  </eClassifiers>
Re: [CDO]Rollback in DBStore NullPointerException [message #990351 is a reply to message #990342] Wed, 12 December 2012 00:37 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5482
Registered: July 2009
Senior Member
Am 12.12.2012 00:47, schrieb Andrew Whelan:
> Eike,
>
> I was able to make the offending Enum transient just for a test and was then able to save some data!
>
> I'm not sure how I can change the meta model so the literal value is default instead of the ordinal (I think this is
> what you are asking me to do)?
It's not a problem in the EEnum but rather in the EAttribute that uses the EEnum as its EType. Have you commented on the
bug that I pointed you to?

Cheers
/Eike

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


>
> Following is the XML snippet of the offending EEnum in the .core file. Is there an attribute I can add to do what you
> are asking? Or is it something I need to change in the code that is generated?
>
> <eClassifiers xsi:type="ecore:EEnum" name="ValueType" serializable="false">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="Enumeration to specify the types of Values that can be attached to a
> property."/>
> </eAnnotations>
> <eLiterals name="VALUE" value="2">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="The current property holds a value"/>
> </eAnnotations>
> </eLiterals>
> <eLiterals name="NA">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="Means the current property is Not Applicable to the containing instance"/>
> </eAnnotations>
> </eLiterals>
> <eLiterals name="UNKNOWN" value="1">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="The current Property is unknown for the containing instance"/>
> </eAnnotations>
> </eLiterals>
> </eClassifiers>
Re: [CDO]Rollback in DBStore NullPointerException [message #990454 is a reply to message #990351] Wed, 12 December 2012 10:04 Go to previous message
Andrew Whelan is currently offline Andrew Whelan
Messages: 69
Registered: October 2012
Location: Syracuse NY
Member
Eike,

Ok, I was actually able to give the EAttribute a default literal value for the EENum that it was using to solve the problem just as you expained. Thanks! I left a comment on the bug report you pointed me to also.
Thanks for everything!
Previous Topic:[CDO] CDO Query which is not DB specific
Next Topic:Refering to UML concepts from EMF model
Goto Forum:
  


Current Time: Mon Jul 28 08:30:48 EDT 2014

Powered by FUDForum. Page generated in 0.07843 seconds