Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Client/Server App with EMF and Teneo
Client/Server App with EMF and Teneo [message #61280] Tue, 14 November 2006 11:30 Go to next message
Eclipse UserFriend
Originally posted by: c.donhofer.chello.at

hi all!

me and my colleagues are currently working on an application
using EMF & hibernate (via teneo).
it's a client-server app and i think this is the reason for our actual
problem. our tool works as follows:

users can create objects offline (using an emf editor) and save their work
either off- or online.
when an object has been saved to the database, (other) users can download,
edit and save the object as an XMI resource on their filesystem. after
finishing their work, they can connect to the database (creating a new
session for the transaction) and update the changes, and that's where the
problem occurs: hibernate can't update the object in the db(using
saveorupdate/merge) if it's already present. as i understand it, because
the object has been saved locally in the meantime and cannot be associated
to the object in the database anymore(despite of having the same class &
id).

we've been searching for a solution for this problem for quite a while now,
finding a podcast on eclipsezone with ed merks in which he (unfortunately
only for a minute)talked about sending a changedescription from client to
server instead of the changed object itself. i tried to implement this
but quickly found out that a changerecorder/description is rather meant
to be used for an undo/redo command, since it only records the values
before the changes.

is there a good approach for our application? the only thing left i can
think of is applying all changes "manually" online - but i believe there
must be a better way.

thanks in advance, chris
Re: Client/Server App with EMF and Teneo [message #61304 is a reply to message #61280] Tue, 14 November 2006 11:51 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
The hibernateresource does saveOrUpdate which should do what you want (update the object in the
database or create a new one). For this to work correctly (with client-server scenarios) you need to
have an id and version property in your model.

Do you get an exception when persisting the changes back?

gr. Martin

Christian Donhofer wrote:
> hi all!
>
> me and my colleagues are currently working on an application
> using EMF & hibernate (via teneo).
> it's a client-server app and i think this is the reason for our actual
> problem. our tool works as follows:
>
> users can create objects offline (using an emf editor) and save their work
> either off- or online.
> when an object has been saved to the database, (other) users can download,
> edit and save the object as an XMI resource on their filesystem. after
> finishing their work, they can connect to the database (creating a new
> session for the transaction) and update the changes, and that's where the
> problem occurs: hibernate can't update the object in the db(using
> saveorupdate/merge) if it's already present. as i understand it, because
> the object has been saved locally in the meantime and cannot be associated
> to the object in the database anymore(despite of having the same class &
> id).
>
> we've been searching for a solution for this problem for quite a while now,
> finding a podcast on eclipsezone with ed merks in which he (unfortunately
> only for a minute)talked about sending a changedescription from client to
> server instead of the changed object itself. i tried to implement this
> but quickly found out that a changerecorder/description is rather meant
> to be used for an undo/redo command, since it only records the values
> before the changes.
>
> is there a good approach for our application? the only thing left i can
> think of is applying all changes "manually" online - but i believe there
> must be a better way.
>
> thanks in advance, chris


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Client/Server App with EMF and Teneo [message #61328 is a reply to message #61304] Tue, 14 November 2006 13:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

hi martin,

here's an example of an XMI resource i use:

-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<learningobjects:LearningUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:learningobjects="learningobjects.ecore" luFile="" id="learn-73339A20-7762-30F9-19C1-0E628D1ADDC7" timestamp="2006-11-12T17:04:45.258+0100">
<luMeta creationDate="0017-04-28T00:00:00.000+0100" id="leame-F3E3A044-7F3F-8EB7-009E-35BCB119DEB8" timestamp="2006-11-11T17:05:20.612+0100" defLang="deu">
<didacMeta title="mydidacmeta" keywords=""/>
<authors id="autho-847678C2-D4A6-A6A5-21EB-8B4576EAF36B" timestamp="2006-11-11T17:05:42.218+0100"/>
<publishInfo edition="myed" pubdate="2006-11-11" id="pubin-30C904BE-0806-0EEC-B42B-78E1AF6723AD" timestamp="2006-11-11T17:05:44.665+0100"/>
</luMeta>
<accessControl status="okeydokey my old okey">
<userauthorization/>
<editionHistory/>
</accessControl>
<item/>
</learningobjects:LearningUnit>
-----------------------

the 'id' attribute value is the same as for the db-persistet object.
when trying to use saveOrUpdate, i get the following exception.

----------------------------------
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [LearningUnit#learn-3F8E37AC-1D82-A875-CC6D-8CBFBB9EBDD0]
at org.hibernate.engine.StatefulPersistenceContext.checkUniquen ess(StatefulPersistenceContext.java:556)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:258)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
at org.hibernate.event.def.DefaultUpdateEventListener.performSa veOrUpdate(DefaultUpdateEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:5 59)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:547)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:539)
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:334)
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.persi stObject(DatabaseServices.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.xmlrpc.server.PropertyHandlerMapping$1.execute(Pr opertyHandlerMapping.java:141)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcSe rverWorker.java:43)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.j ava:65)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcSt reamServer.java:209)
at org.apache.xmlrpc.webserver.Connection.run(Connection.java:1 68)
at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
org.eclipse.emf.teneo.hibernate.HbStoreException: Exception when saving resource file:/D:/_dev/ATPrototyp/runtime-Authortool.0.3/TestLU.learn ingobjects in AuthortoolDataStore
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:356)
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.persi stObject(DatabaseServices.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.xmlrpc.server.PropertyHandlerMapping$1.execute(Pr opertyHandlerMapping.java:141)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcSe rverWorker.java:43)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.j ava:65)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcSt reamServer.java:209)
at org.apache.xmlrpc.webserver.Connection.run(Connection.java:1 68)
at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [LearningUnit#learn-3F8E37AC-1D82-A875-CC6D-8CBFBB9EBDD0]
at org.hibernate.engine.StatefulPersistenceContext.checkUniquen ess(StatefulPersistenceContext.java:556)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:258)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
at org.hibernate.event.def.DefaultUpdateEventListener.performSa veOrUpdate(DefaultUpdateEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:5 59)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:547)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:539)
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:334)
... 12 more
----------------------------------

thx & greets, chris




On Tue, 14 Nov 2006 12:51:47 +0100 wrote Martin Taal:

> Hi Christian,
> The hibernateresource does saveOrUpdate which should do what you want (update the object in the
> database or create a new one). For this to work correctly (with client-server scenarios) you need to
> have an id and version property in your model.
>
> Do you get an exception when persisting the changes back?
>
> gr. Martin
>
Re: Client/Server App with EMF and Teneo [message #61352 is a reply to message #61328] Tue, 14 November 2006 13:43 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Chris,
How is it possible that there is already an object with the same id in the resource/session?

Can you describe the flow and the creation/use of the (hibernate)resource?

gr. Martin

Christian Donhofer wrote:
> hi martin,
>
> here's an example of an XMI resource i use:
>
> -----------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <learningobjects:LearningUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:learningobjects="learningobjects.ecore" luFile="" id="learn-73339A20-7762-30F9-19C1-0E628D1ADDC7" timestamp="2006-11-12T17:04:45.258+0100">
> <luMeta creationDate="0017-04-28T00:00:00.000+0100" id="leame-F3E3A044-7F3F-8EB7-009E-35BCB119DEB8" timestamp="2006-11-11T17:05:20.612+0100" defLang="deu">
> <didacMeta title="mydidacmeta" keywords=""/>
> <authors id="autho-847678C2-D4A6-A6A5-21EB-8B4576EAF36B" timestamp="2006-11-11T17:05:42.218+0100"/>
> <publishInfo edition="myed" pubdate="2006-11-11" id="pubin-30C904BE-0806-0EEC-B42B-78E1AF6723AD" timestamp="2006-11-11T17:05:44.665+0100"/>
> </luMeta>
> <accessControl status="okeydokey my old okey">
> <userauthorization/>
> <editionHistory/>
> </accessControl>
> <item/>
> </learningobjects:LearningUnit>
> -----------------------
>
> the 'id' attribute value is the same as for the db-persistet object.
> when trying to use saveOrUpdate, i get the following exception.
>
> ----------------------------------
> org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [LearningUnit#learn-3F8E37AC-1D82-A875-CC6D-8CBFBB9EBDD0]
> at org.hibernate.engine.StatefulPersistenceContext.checkUniquen ess(StatefulPersistenceContext.java:556)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:258)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
> at org.hibernate.event.def.DefaultUpdateEventListener.performSa veOrUpdate(DefaultUpdateEventListener.java:33)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
> at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:5 59)
> at org.hibernate.impl.SessionImpl.update(SessionImpl.java:547)
> at org.hibernate.impl.SessionImpl.update(SessionImpl.java:539)
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:334)
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.persi stObject(DatabaseServices.java:446)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.apache.xmlrpc.server.PropertyHandlerMapping$1.execute(Pr opertyHandlerMapping.java:141)
> at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcSe rverWorker.java:43)
> at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.j ava:65)
> at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcSt reamServer.java:209)
> at org.apache.xmlrpc.webserver.Connection.run(Connection.java:1 68)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
> org.eclipse.emf.teneo.hibernate.HbStoreException: Exception when saving resource file:/D:/_dev/ATPrototyp/runtime-Authortool.0.3/TestLU.learn ingobjects in AuthortoolDataStore
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:356)
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.persi stObject(DatabaseServices.java:446)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.apache.xmlrpc.server.PropertyHandlerMapping$1.execute(Pr opertyHandlerMapping.java:141)
> at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcSe rverWorker.java:43)
> at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.j ava:65)
> at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcSt reamServer.java:209)
> at org.apache.xmlrpc.webserver.Connection.run(Connection.java:1 68)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
> Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [LearningUnit#learn-3F8E37AC-1D82-A875-CC6D-8CBFBB9EBDD0]
> at org.hibernate.engine.StatefulPersistenceContext.checkUniquen ess(StatefulPersistenceContext.java:556)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:258)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
> at org.hibernate.event.def.DefaultUpdateEventListener.performSa veOrUpdate(DefaultUpdateEventListener.java:33)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
> at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:5 59)
> at org.hibernate.impl.SessionImpl.update(SessionImpl.java:547)
> at org.hibernate.impl.SessionImpl.update(SessionImpl.java:539)
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:334)
> ... 12 more
> ----------------------------------
>
> thx & greets, chris
>
>
>
>
> On Tue, 14 Nov 2006 12:51:47 +0100 wrote Martin Taal:
>
>> Hi Christian,
>> The hibernateresource does saveOrUpdate which should do what you want (update the object in the
>> database or create a new one). For this to work correctly (with client-server scenarios) you need to
>> have an id and version property in your model.
>>
>> Do you get an exception when persisting the changes back?
>>
>> gr. Martin
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Client/Server App with EMF and Teneo [message #61544 is a reply to message #61352] Wed, 15 November 2006 17:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

hi martin,

sorry i posted the wrong exception (using a wrong version of the
applicaton) last time.

I try to update the following object in the database:

<?xml version="1.0" encoding="UTF-8"?>
<lobj:LearningUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore" id="id-01" timestamp="2006-10-10T00:00:00.000+0200" luFile="asdsad">
<luMeta id="leame-95EE2680-9A22-4647-2B09-66413AB827D5" timestamp="2006-11-15T13:18:16.921+0100" creationDate="2006-12-12T00:00:00.000+0100">
<defLang href="Lang_de.learningobjects#de"/>
</luMeta>
<item luRef="sadasd">
<corrBlock>
<presentationBlock lod="2" rendering="PC">
<block xsi:type="lobj:HypertextBlock" href=" TestBlock.learningobjects#hyblo-42F36FDE-5CF6-FF93-3C9F-F5CB F5867B5D "/>
</presentationBlock>
<titleMeta title="mytitle">
<language href="Lang_de.learningobjects#de"/>
</titleMeta>
</corrBlock>
</item>
</lobj:LearningUnit>

The EObject "LearningUnit" already exists in the database and contains
several EObjects. For each EObject in the resource the "saveOrUpdate"
method is called. See the following code snippet:
---------------
tx = mySession.beginTransaction();
final List list = resource.getContents();
for (int i = 0; i < list.size(); i++) {
tObj = list.get(i);

mySession.saveOrUpdate(tObj);
}

// now flush everything
mySession.flush();
err = false;
---------------

Anyhow, it seems that the application tries to save each EObject as a new
one, beginning with the EObject "Language". here's the exception:

-------------------------------------------------

17:55:47,375 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
17:55:47,375 DEBUG SQL:346 - insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`) values (?, ?, 'Language', ?)
17:55:47,375 DEBUG AbstractBatcher:424 - preparing statement
17:55:47,390 DEBUG AbstractEntityPersister:1821 - Dehydrating entity: [Language#de]
17:55:47,390 DEBUG AbstractBatcher:28 - Adding to batch
17:55:47,390 DEBUG AbstractEntityPersister:2034 - Inserting entity: [LuMeta#leame-95EE2680-9A22-4647-2B09-66413AB827D5]
17:55:47,390 DEBUG AbstractEntityPersister:2035 - Version: 0
17:55:47,390 DEBUG AbstractBatcher:55 - Executing batch size: 1
17:55:47,390 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
17:55:47,390 DEBUG AbstractBatcher:470 - closing statement
17:55:47,390 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC batch update [insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`) values (?, ?, 'Language', ?)]
java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:91)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:86)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abs tractBatcher.java:171)
at org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2048)
[...]
at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
17:55:47,390 WARN JDBCExceptionReporter:71 - SQL Error: 1062, SQLState: 23000
17:55:47,406 ERROR JDBCExceptionReporter:72 - Duplicate entry 'de' for key 1
17:55:47,406 DEBUG DatabaseServices:304 - Exception in DatabaseServices.saveResource: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
17:55:47,406 DEBUG DatabaseServices:305 - --- Message: Could not execute JDBC batch update
17:55:47,421 ERROR HbStoreException:47 - Exception when saving resource file:/D:/_dev/ATPrototyp/runtime-Authortool.0.4/TestObjects/ TestLU.learningobjects in AuthortoolDataStore
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateCo nverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce ptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:202)
[...]
at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
Caused by: java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
at
com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
at
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
... 51 more
-------------------------------------------------

On Tue, 14 Nov 2006 14:43:14 +0100 wrote Martin Taal:

> Hi Chris,
> How is it possible that there is already an object with the same id in the resource/session?
>
> Can you describe the flow and the creation/use of the (hibernate)resource?
>
> gr. Martin
Re: Client/Server App with EMF and Teneo [message #61558 is a reply to message #61544] Wed, 15 November 2006 18:06 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
Can you send me the ecore? And an xml file with the data you try to persist (or a subset of it)?
Then I can test myself what happens.

gr. Martin

Christian Donhofer wrote:
> hi martin,
>
> sorry i posted the wrong exception (using a wrong version of the
> applicaton) last time.
>
> I try to update the following object in the database:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <lobj:LearningUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore" id="id-01" timestamp="2006-10-10T00:00:00.000+0200" luFile="asdsad">
> <luMeta id="leame-95EE2680-9A22-4647-2B09-66413AB827D5" timestamp="2006-11-15T13:18:16.921+0100" creationDate="2006-12-12T00:00:00.000+0100">
> <defLang href="Lang_de.learningobjects#de"/>
> </luMeta>
> <item luRef="sadasd">
> <corrBlock>
> <presentationBlock lod="2" rendering="PC">
> <block xsi:type="lobj:HypertextBlock" href=" TestBlock.learningobjects#hyblo-42F36FDE-5CF6-FF93-3C9F-F5CB F5867B5D "/>
> </presentationBlock>
> <titleMeta title="mytitle">
> <language href="Lang_de.learningobjects#de"/>
> </titleMeta>
> </corrBlock>
> </item>
> </lobj:LearningUnit>
>
> The EObject "LearningUnit" already exists in the database and contains
> several EObjects. For each EObject in the resource the "saveOrUpdate"
> method is called. See the following code snippet:
> ---------------
> tx = mySession.beginTransaction();
> final List list = resource.getContents();
> for (int i = 0; i < list.size(); i++) {
> tObj = list.get(i);
>
> mySession.saveOrUpdate(tObj);
> }
>
> // now flush everything
> mySession.flush();
> err = false;
> ---------------
>
> Anyhow, it seems that the application tries to save each EObject as a new
> one, beginning with the EObject "Language". here's the exception:
>
> -------------------------------------------------
>
> 17:55:47,375 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
> 17:55:47,375 DEBUG SQL:346 - insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`) values (?, ?, 'Language', ?)
> 17:55:47,375 DEBUG AbstractBatcher:424 - preparing statement
> 17:55:47,390 DEBUG AbstractEntityPersister:1821 - Dehydrating entity: [Language#de]
> 17:55:47,390 DEBUG AbstractBatcher:28 - Adding to batch
> 17:55:47,390 DEBUG AbstractEntityPersister:2034 - Inserting entity: [LuMeta#leame-95EE2680-9A22-4647-2B09-66413AB827D5]
> 17:55:47,390 DEBUG AbstractEntityPersister:2035 - Version: 0
> 17:55:47,390 DEBUG AbstractBatcher:55 - Executing batch size: 1
> 17:55:47,390 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
> 17:55:47,390 DEBUG AbstractBatcher:470 - closing statement
> 17:55:47,390 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC batch update [insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`) values (?, ?, 'Language', ?)]
> java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
> at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
> at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
> at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:91)
> at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:86)
> at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abs tractBatcher.java:171)
> at org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2048)
> [...]
> at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
> 17:55:47,390 WARN JDBCExceptionReporter:71 - SQL Error: 1062, SQLState: 23000
> 17:55:47,406 ERROR JDBCExceptionReporter:72 - Duplicate entry 'de' for key 1
> 17:55:47,406 DEBUG DatabaseServices:304 - Exception in DatabaseServices.saveResource: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
> 17:55:47,406 DEBUG DatabaseServices:305 - --- Message: Could not execute JDBC batch update
> 17:55:47,421 ERROR HbStoreException:47 - Exception when saving resource file:/D:/_dev/ATPrototyp/runtime-Authortool.0.4/TestObjects/ TestLU.learningobjects in AuthortoolDataStore
> org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateCo nverter.java:71)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce ptionHelper.java:43)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:202)
> [...]
> at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
> Caused by: java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
> at
> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
> at
> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
> at
> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
> ... 51 more
> -------------------------------------------------
>
> On Tue, 14 Nov 2006 14:43:14 +0100 wrote Martin Taal:
>
>> Hi Chris,
>> How is it possible that there is already an object with the same id in the resource/session?
>>
>> Can you describe the flow and the creation/use of the (hibernate)resource?
>>
>> gr. Martin


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Client/Server App with EMF and Teneo [message #61730 is a reply to message #61558] Thu, 16 November 2006 18:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

This is a multi-part message in MIME format.
--------------090804040307040001090309
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

hi martin,

all needed files are attached!

cheers, chris

Martin Taal wrote:
> Hi Christian,
> Can you send me the ecore? And an xml file with the data you try to
> persist (or a subset of it)?
> Then I can test myself what happens.
>
> gr. Martin
>
> Christian Donhofer wrote:
>
>> hi martin,
>>
>> sorry i posted the wrong exception (using a wrong version of the
>> applicaton) last time.
>>
>> I try to update the following object in the database:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <lobj:LearningUnit xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:lobj="lobj.ecore" id="id-01"
>> timestamp="2006-10-10T00:00:00.000+0200" luFile="asdsad">
>> <luMeta id="leame-95EE2680-9A22-4647-2B09-66413AB827D5"
>> timestamp="2006-11-15T13:18:16.921+0100"
>> creationDate="2006-12-12T00:00:00.000+0100">
>> <defLang href="Lang_de.learningobjects#de"/>
>> </luMeta>
>> <item luRef="sadasd">
>> <corrBlock>
>> <presentationBlock lod="2" rendering="PC">
>> <block xsi:type="lobj:HypertextBlock"
>> href=" TestBlock.learningobjects#hyblo-42F36FDE-5CF6-FF93-3C9F-F5CB F5867B5D "/>
>>
>> </presentationBlock>
>> <titleMeta title="mytitle">
>> <language href="Lang_de.learningobjects#de"/>
>> </titleMeta>
>> </corrBlock>
>> </item>
>> </lobj:LearningUnit>
>>
>> The EObject "LearningUnit" already exists in the database and contains
>> several EObjects. For each EObject in the resource the "saveOrUpdate"
>> method is called. See the following code snippet: ---------------
>> tx = mySession.beginTransaction();
>> final List list = resource.getContents();
>> for (int i = 0; i < list.size(); i++) {
>> tObj = list.get(i);
>>
>> mySession.saveOrUpdate(tObj);
>> }
>>
>> // now flush everything
>> mySession.flush();
>> err = false; ---------------
>>
>> Anyhow, it seems that the application tries to save each EObject as a new
>> one, beginning with the EObject "Language". here's the exception:
>>
>> -------------------------------------------------
>>
>> 17:55:47,375 DEBUG AbstractBatcher:311 - about to open
>> PreparedStatement (open PreparedStatements: 0, globally: 0)
>> 17:55:47,375 DEBUG SQL:346 - insert into `LANGUAGE` (vn, `LANGUAGE`,
>> `DTYPE`, `CODE`) values (?, ?, 'Language', ?)
>> 17:55:47,375 DEBUG AbstractBatcher:424 - preparing statement
>> 17:55:47,390 DEBUG AbstractEntityPersister:1821 - Dehydrating entity:
>> [Language#de]
>> 17:55:47,390 DEBUG AbstractBatcher:28 - Adding to batch
>> 17:55:47,390 DEBUG AbstractEntityPersister:2034 - Inserting entity:
>> [LuMeta#leame-95EE2680-9A22-4647-2B09-66413AB827D5]
>> 17:55:47,390 DEBUG AbstractEntityPersister:2035 - Version: 0
>> 17:55:47,390 DEBUG AbstractBatcher:55 - Executing batch size: 1
>> 17:55:47,390 DEBUG AbstractBatcher:319 - about to close
>> PreparedStatement (open PreparedStatements: 1, globally: 1)
>> 17:55:47,390 DEBUG AbstractBatcher:470 - closing statement
>> 17:55:47,390 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC
>> batch update [insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`)
>> values (?, ?, 'Language', ?)]
>> java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
>> at
>> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
>>
>> at
>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
>> at
>> org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:91)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:86)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abs tractBatcher.java:171)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2048)
>>
>> [...]
>> at
>> org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
>> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
>> 17:55:47,390 WARN JDBCExceptionReporter:71 - SQL Error: 1062,
>> SQLState: 23000
>> 17:55:47,406 ERROR JDBCExceptionReporter:72 - Duplicate entry 'de' for
>> key 1
>> 17:55:47,406 DEBUG DatabaseServices:304 - Exception in
>> DatabaseServices.saveResource:
>> org.hibernate.exception.ConstraintViolationException: Could not
>> execute JDBC batch update
>> 17:55:47,406 DEBUG DatabaseServices:305 - --- Message: Could not
>> execute JDBC batch update
>> 17:55:47,421 ERROR HbStoreException:47 - Exception when saving
>> resource
>> file:/D:/_dev/ATPrototyp/runtime-Authortool.0.4/TestObjects/ TestLU.learningobjects
>> in AuthortoolDataStore
>> org.hibernate.exception.ConstraintViolationException: Could not
>> execute JDBC batch update
>> at
>> org.hibernate.exception.SQLStateConverter.convert(SQLStateCo nverter.java:71)
>>
>> at
>> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce ptionHelper.java:43)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:202)
>> [...]
>> at
>> org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
>> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
>> Caused by: java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
>> at
>> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
>>
>> at
>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
>>
>> ... 51 more
>> -------------------------------------------------
>>
>> On Tue, 14 Nov 2006 14:43:14 +0100 wrote Martin Taal:
>>
>>> Hi Chris,
>>> How is it possible that there is already an object with the same id
>>> in the resource/session?
>>>
>>> Can you describe the flow and the creation/use of the
>>> (hibernate)resource?
>>>
>>> gr. Martin
>
>
>


--------------090804040307040001090309
Content-Type: application/zip;
name="TestObjects.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="TestObjects.zip"

UEsDBBQAAAAIAK6ObzXQcKxoiAAAAKQAAAAXAAAATGFuZ19kZS5sZWFybmlu Z29iamVjdHM9
jsEKAiEQhu9B7yBzT6tTyNpeIgjqVtB1cwfXcJ1QN/fxU6guP8ww3zd/086j Y28M0ZJXsOFr
YOg19dYbBbfrcbWDdr9cNI4eT3nuvJk6g2werfxD2woVjY+y7BUMKb2kEDln TqPhFIy4X06/
kypSUJOjpoDA3Neq4IBTinoAVgqUsUcQ5fcHUEsDBBQAAAAIAK6ObzV+rpLK ywEAAHsDAAAZ
AAAAVGVzdEJsb2NrLmxlYXJuaW5nb2JqZWN0c5VTy66bMBDdV+o/WO7yymAD 5qWkV4nBaqVm
l0rdVQ5MElqwI3Cb5O9rSMji6vYlGeQZzZwzc2a8eL50LfoJ/dAYvcTMoxiB rkzd6MMSf95K
kuLn92/fLFqz+5Z/uJ6gt3Cx69ZU39Gla/JHajCmOjA95M6/xEdrT7nvn89n z3QHz/QH/8vm
4xwywi3x+PegMj1g1NQu57prDYkCGcayKAkXMiZSZiEJRSaJ5GIteRona15g ZJsOBqu6k6Om
NCaMEca3LMwZz3nkBTF/ooxS7IpHaLEbC96AVROPszogNC2yQKwiEhRyRVjE MxImq5JkXBS0
yFiUpKs/8cQ5TbwkZTce1BqHHGDUg66hn/Q7VRhVPSjrFCqUhRmCurOlNJ+O Ryl9osEEoQa7
cdrvG6inWP7b2Kkt19jQdKcWiqZW1dSebWzreO6XOcwFtkoffqgDoGMP+yX+ 5MyvNXgtqF67
Yt0koLLDuxqwP2P7L8Bnfw37Mf1fkRb+Q/2bfZzXSBhtQdv77CujScmjgIlQ kDRJIpJJJohM
I0aKOEpEmaTrshR/mX3iUXafPTqCum2y0tfZcCO50Y57oNAr30Pc/9Vs4b9s bXw6/itvx/l/
AVBLAwQUAAAACACujm81lgGOd90BAABqAwAAFgAAAFRlc3RMVS5sZWFybmlu Z29iamVjdHON
U9uK2zAQfS/0H4z6uMiW5NiJTdxlczFdyELpZqFvRWvPJmplOchKk/x9x8ql ZNOHgjCjmTMz
Z85Y4/t9o4PfYDvVmoLwkJEATNXWyqwK8rIs6Yjcf/74Yazb15/5AqQ1GHkx ygX7RuWXRNEn
YinT5egvyNq5TR5Fu90ubJtV2NpV9P3p8QLpriG72CMEYxxhi+dqDY2kynRO mgrOWT2FgvTf
EKrWol/VBVE1ZZwETjWA8GaDXBhLKWd4lozl/oSMsTuGARLobak0FER2dSdr grMFwVhvn8BJ
X0+DbIBmyXwu0hGj2YMQdJAOhlRMWEbTdMDjh8lIDGfJP5pyypMlj3M+ynka ZoLfMd43rSxI
h0LNpIMzVuB5R7DHekJIqYa3hTSrYG3hrSC9+aOGUJ82gCJA5bpPNZDoOEJ0 nOF4UQ4anPRb
n4pT4qyXuqicnei2+nVyoGtjoQPjPEMfCnSLSggSWDA1WP8vfJ2SSwbmvHoc LjJ3hw0c15J/
QdM62DtfhZy4L1Ej77hhvz5gGToQZZyWszlNpmVKyzKLaTzNSlom00mZjNLh JJmdpvStoxu+
f2NOOQ1+l94qSHPwxhV3jWJu5Qr+V9tj10vps5LRtZTjqFe9fyvRzWNB7x9Q SwECFAAUAAAA
CACujm810HCsaIgAAACkAAAAFwAAAAAAAAABACAAAAAAAAAATGFuZ19kZS5s ZWFybmluZ29i
amVjdHNQSwECFAAUAAAACACujm81fq6SyssBAAB7AwAAGQAAAAAAAAABACAA AAC9AAAAVGVz
dEJsb2NrLmxlYXJuaW5nb2JqZWN0c1BLAQIUABQAAAAIAK6ObzWWAY533QEA AGoDAAAWAAAA
AAAAAAEAIAAAAL8CAABUZXN0TFUubGVhcm5pbmdvYmplY3RzUEsFBgAAAAAD AAMA0AAAANAE
AAAAAA==
--------------090804040307040001090309
Content-Type: text/xml;
name="lobj.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="lobj.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="lobj"
nsURI="lobj.ecore" nsPrefix="lobj">
<eClassifiers xsi:type="ecore:EClass" name="LearningObject" abstract="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="learningObject"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" unique="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//ID" iD="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="id"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="timestamp" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="timestamp"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="synchronized" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="synchronized"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Block" abstract="true" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="block"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="blockMeta" lowerBound="1"
eType="#//BlockMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="blockMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="externalMetadata"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="source" eType="#//Source"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="source"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="HypertextBlock" eSuperTypes="#//Block">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="hypertextBlock"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="hypertextContent" upperBound="-1"
eType="#//HypertextContent" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="hypertextContent"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractContent" abstract="true" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="abstractContent"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="heading" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="heading"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="language" eType="#//Language"
resolveProxies="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="language"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="HypertextContent" eSuperTypes="#//AbstractContent">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="hypertextContent"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="content" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="content"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="blockAudiofile" eType="#//blockAudiofile"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="blockAudiofile"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="resrcFile" upperBound="-1"
eType="#//ResrcFile" eOpposite="#//ResrcFile/hypertextContent">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="resrcFile"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="BlockFolder" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="blockFolder"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
eType="#//FolderMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="folderMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="blockFolder" upperBound="-1"
eType="#//BlockFolder" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="blockFolder"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="block" upperBound="-1"
eType="#//Block" containment="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="block"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Category" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="category"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="titleMeta" upperBound="-1"
eType="#//TitleMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="categoryDidacMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="course" upperBound="-1"
eType="#//Course" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="course"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="CorrBlock">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="corrBlock"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="presentationBlock" upperBound="-1"
eType="#//PresentationBlock" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="presentationBlock"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="titleMeta" upperBound="-1"
eType="#//TitleMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="categoryDidacMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Course" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="course"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="courseMeta" lowerBound="1"
eType="#//CourseMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="courseMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="externalMetadata"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="coursetype" eType="#//Coursetype">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="coursetype"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="outlineAsXml" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="outlineAsXml"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="module" upperBound="-1"
eType="#//Module"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Item">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="item"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="corrBlock" upperBound="-1"
eType="#//CorrBlock" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="corrBlock"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="childitems" upperBound="-1"
eType="#//Item" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="item"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="luRef" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LearningUnit" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="learningUnit"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="luMeta" lowerBound="1"
eType="#//LuMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="luMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="externalMetadata"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="treeAsXml" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="treeAsXml"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="luFile" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="luFile"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//Item"
containment="true" resolveProxies="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LuFolder" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="luFolder"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
eType="#//FolderMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="folderMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="luFolder" upperBound="-1"
eType="#//LuFolder" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="luFolder"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="learningUnit" upperBound="-1"
eType="#//LearningUnit" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="learningUnit"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Module" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="module"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="moduleMeta" lowerBound="1"
eType="#//ModuleMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="moduleMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="externalMetadata"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="rootNode" eType="#//Node"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="rootNode"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="moduleFile" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="moduleFile"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="treeAsXml" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="treeAsXml"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ModuleFolder" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="moduleFolder"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
eType="#//FolderMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="folderMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="moduleFolder" upperBound="-1"
eType="#//ModuleFolder" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="moduleFolder"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="module" upperBound="-1"
eType="#//Module" containment="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="module"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ResrcFolder" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="resrcFolder"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
eType="#//FolderMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="folderMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="resrcFolder" upperBound="-1"
eType="#//ResrcFolder" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="resrcFolder"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteScheduled" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="deleteScheduled"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="resrcFile" upperBound="-1"
eType="#//ResrcFile" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="resrcFile"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Theme" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="theme"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="simpleDidacMeta" upperBound="-1"
eType="#//SimpleDidacMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="simpleDidacMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="

Report message to a moderator

Re: Client/Server App with EMF and Teneo [message #62094 is a reply to message #61730] Sat, 18 November 2006 06:13 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020108020703090309000804
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Christian,
I tested it. This occurs because the types do not have an explicit version efeature in the ecore model.
If a type does not have a version property then teneo will add a so-called synthetic version
property in the hibernate mapping. When an object is saved or loaded then the version is maintained
in a cache by Teneo. This is a weakreference cache which means that if the object is
garbage-collected that the version information is removed, also the cache works with object (memory
equality). For example the version info is removed when your object is sent to the client (and
leaves the server in a way).
When the object then gets back from the client the version information is not present in the cache
anymore and hibernate will think that no version is set and therefor that it is a new object.

To solve this you need to add to each type a version eattribute. As an example I have added one to
Language (see attached ecore), the xmi test file then also needs it.

I will add a separate section on elver.org to highlight that for client-server scenarios you need
explicit version and id properties. It is partially mentioned here:
http://www.elver.org/hibernate/hibernate_details.html#Synthe tic+ID+and+Version+properties
but this is not clear enough.

gr. Martin

Christian Donhofer wrote:
> hi martin,
>
> all needed files are attached!
>
> cheers, chris
>
> Martin Taal wrote:
>> Hi Christian,
>> Can you send me the ecore? And an xml file with the data you try to
>> persist (or a subset of it)?
>> Then I can test myself what happens.
>>
>> gr. Martin
>>
>> Christian Donhofer wrote:
>>
>>> hi martin,
>>>
>>> sorry i posted the wrong exception (using a wrong version of the
>>> applicaton) last time.
>>>
>>> I try to update the following object in the database:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <lobj:LearningUnit xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:lobj="lobj.ecore" id="id-01"
>>> timestamp="2006-10-10T00:00:00.000+0200" luFile="asdsad">
>>> <luMeta id="leame-95EE2680-9A22-4647-2B09-66413AB827D5"
>>> timestamp="2006-11-15T13:18:16.921+0100"
>>> creationDate="2006-12-12T00:00:00.000+0100">
>>> <defLang href="Lang_de.learningobjects#de"/>
>>> </luMeta>
>>> <item luRef="sadasd">
>>> <corrBlock>
>>> <presentationBlock lod="2" rendering="PC">
>>> <block xsi:type="lobj:HypertextBlock"
>>> href=" TestBlock.learningobjects#hyblo-42F36FDE-5CF6-FF93-3C9F-F5CB F5867B5D "/>
>>>
>>> </presentationBlock>
>>> <titleMeta title="mytitle">
>>> <language href="Lang_de.learningobjects#de"/>
>>> </titleMeta>
>>> </corrBlock>
>>> </item>
>>> </lobj:LearningUnit>
>>>
>>> The EObject "LearningUnit" already exists in the database and contains
>>> several EObjects. For each EObject in the resource the "saveOrUpdate"
>>> method is called. See the following code snippet: ---------------
>>> tx = mySession.beginTransaction();
>>> final List list = resource.getContents();
>>> for (int i = 0; i < list.size(); i++) {
>>> tObj = list.get(i);
>>>
>>> mySession.saveOrUpdate(tObj);
>>> }
>>>
>>> // now flush everything
>>> mySession.flush();
>>> err = false; ---------------
>>>
>>> Anyhow, it seems that the application tries to save each EObject as a new
>>> one, beginning with the EObject "Language". here's the exception:
>>>
>>> -------------------------------------------------
>>>
>>> 17:55:47,375 DEBUG AbstractBatcher:311 - about to open
>>> PreparedStatement (open PreparedStatements: 0, globally: 0)
>>> 17:55:47,375 DEBUG SQL:346 - insert into `LANGUAGE` (vn, `LANGUAGE`,
>>> `DTYPE`, `CODE`) values (?, ?, 'Language', ?)
>>> 17:55:47,375 DEBUG AbstractBatcher:424 - preparing statement
>>> 17:55:47,390 DEBUG AbstractEntityPersister:1821 - Dehydrating entity:
>>> [Language#de]
>>> 17:55:47,390 DEBUG AbstractBatcher:28 - Adding to batch
>>> 17:55:47,390 DEBUG AbstractEntityPersister:2034 - Inserting entity:
>>> [LuMeta#leame-95EE2680-9A22-4647-2B09-66413AB827D5]
>>> 17:55:47,390 DEBUG AbstractEntityPersister:2035 - Version: 0
>>> 17:55:47,390 DEBUG AbstractBatcher:55 - Executing batch size: 1
>>> 17:55:47,390 DEBUG AbstractBatcher:319 - about to close
>>> PreparedStatement (open PreparedStatements: 1, globally: 1)
>>> 17:55:47,390 DEBUG AbstractBatcher:470 - closing statement
>>> 17:55:47,390 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC
>>> batch update [insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`)
>>> values (?, ?, 'Language', ?)]
>>> java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
>>> at
>>> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
>>>
>>> at
>>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:91)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:86)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abs tractBatcher.java:171)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2048)
>>>
>>> [...]
>>> at
>>> org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
>>> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
>>> 17:55:47,390 WARN JDBCExceptionReporter:71 - SQL Error: 1062,
>>> SQLState: 23000
>>> 17:55:47,406 ERROR JDBCExceptionReporter:72 - Duplicate entry 'de' for
>>> key 1
>>> 17:55:47,406 DEBUG DatabaseServices:304 - Exception in
>>> DatabaseServices.saveResource:
>>> org.hibernate.exception.ConstraintViolationException: Could not
>>> execute JDBC batch update
>>> 17:55:47,406 DEBUG DatabaseServices:305 - --- Message: Could not
>>> execute JDBC batch update
>>> 17:55:47,421 ERROR HbStoreException:47 - Exception when saving
>>> resource
>>> file:/D:/_dev/ATPrototyp/runtime-Authortool.0.4/TestObjects/ TestLU.learningobjects
>>> in AuthortoolDataStore
>>> org.hibernate.exception.ConstraintViolationException: Could not
>>> execute JDBC batch update
>>> at
>>> org.hibernate.exception.SQLStateConverter.convert(SQLStateCo nverter.java:71)
>>>
>>> at
>>> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce ptionHelper.java:43)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:202)
>>> [...]
>>> at
>>> org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
>>> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
>>> Caused by: java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
>>> at
>>> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
>>>
>>> at
>>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
>>>
>>> ... 51 more
>>> -------------------------------------------------
>>>
>>> On Tue, 14 Nov 2006 14:43:14 +0100 wrote Martin Taal:
>>>
>>>> Hi Chris,
>>>> How is it possible that there is already an object with the same id
>>>> in the resource/session?
>>>>
>>>> Can you describe the flow and the creation/use of the
>>>> (hibernate)resource?
>>>>
>>>> gr. Martin
>>
>>
>
>
> ------------------------------------------------------------ ------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="lobj"
> nsURI="lobj.ecore" nsPrefix="lobj">
> <eClassifiers xsi:type="ecore:EClass" name="LearningObject" abstract="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="learningObject"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" unique="false" lowerBound="1"
> eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//ID" iD="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="id"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="timestamp" unique="false"
> lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="timestamp"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="synchronized" unique="false"
> lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="synchronized"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Block" abstract="true" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="block"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="blockMeta" lowerBound="1"
> eType="#//BlockMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="blockMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
> upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="externalMetadata"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="source" eType="#//Source"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="source"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="HypertextBlock" eSuperTypes="#//Block">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="hypertextBlock"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="hypertextContent" upperBound="-1"
> eType="#//HypertextContent" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="hypertextContent"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="AbstractContent" abstract="true" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="abstractContent"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="heading" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="heading"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="language" eType="#//Language"
> resolveProxies="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="language"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="HypertextContent" eSuperTypes="#//AbstractContent">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="hypertextContent"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="content" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="content"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="blockAudiofile" eType="#//blockAudiofile"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="blockAudiofile"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="resrcFile" upperBound="-1"
> eType="#//ResrcFile" eOpposite="#//ResrcFile/hypertextContent">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="resrcFile"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="BlockFolder" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="blockFolder"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
> eType="#//FolderMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="folderMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="blockFolder" upperBound="-1"
> eType="#//BlockFolder" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="blockFolder"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="block" upperBound="-1"
> eType="#//Block" containment="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="block"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Category" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="category"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="titleMeta" upperBound="-1"
> eType="#//TitleMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="categoryDidacMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="course" upperBound="-1"
> eType="#//Course" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="course"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="CorrBlock">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="corrBlock"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="presentationBlock" upperBound="-1"
> eType="#//PresentationBlock" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="presentationBlock"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="titleMeta" upperBound="-1"
> eType="#//TitleMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="categoryDidacMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Course" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="course"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="courseMeta" lowerBound="1"
> eType="#//CourseMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="courseMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
> upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="externalMetadata"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="coursetype" eType="#//Coursetype">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="coursetype"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="outlineAsXml" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="outlineAsXml"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="module" upperBound="-1"
> eType="#//Module"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Item">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="item"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="corrBlock" upperBound="-1"
> eType="#//CorrBlock" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="corrBlock"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="childitems" upperBound="-1"
> eType="#//Item" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="item"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="luRef" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="LearningUnit" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="learningUnit"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="luMeta" lowerBound="1"
> eType="#//LuMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="luMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
> upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="externalMetadata"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="treeAsXml" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="treeAsXml"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="luFile" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="luFile"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//Item"
> containment="true" resolveProxies="false"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="LuFolder" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="luFolder"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
> eType="#//FolderMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="folderMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="luFolder" upperBound="-1"
> eType="#//LuFolder" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="luFolder"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="learningUnit" upperBound="-1"
> eType="#//LearningUnit" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="learningUnit"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Module" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="module"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="moduleMeta" lowerBound="1"
> eType="#//ModuleMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="moduleMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
> upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="externalMetadata"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="rootNode" eType="#//Node"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="rootNode"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="moduleFile" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="moduleFile"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="treeAsXml" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="treeAsXml"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="ModuleFolder" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="moduleFolder"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
> eType="#//FolderMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="folderMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="moduleFolder" upperBound="-1"
> eType="#//ModuleFolder" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="moduleFolder"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="module" upperBound="-1"
> eType="#//Module" containment="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="module"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="ResrcFolder" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="resrcFolder"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
> eType="#//FolderMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="folderMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="resrcFolder" upperBound="-1"
> eType="#//ResrcFolder" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="resrcFolder"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteScheduled" unique="false"
> lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="deleteScheduled"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore
Re: Client/Server App with EMF and Teneo [message #62309 is a reply to message #62094] Mon, 20 November 2006 15:50 Go to previous message
Eclipse UserFriend
Originally posted by: christian.donhofer.net

hi martin,

it's working!

thx alot, chris
Re: Client/Server App with EMF and Teneo [message #595616 is a reply to message #61280] Tue, 14 November 2006 11:51 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
The hibernateresource does saveOrUpdate which should do what you want (update the object in the
database or create a new one). For this to work correctly (with client-server scenarios) you need to
have an id and version property in your model.

Do you get an exception when persisting the changes back?

gr. Martin

Christian Donhofer wrote:
> hi all!
>
> me and my colleagues are currently working on an application
> using EMF & hibernate (via teneo).
> it's a client-server app and i think this is the reason for our actual
> problem. our tool works as follows:
>
> users can create objects offline (using an emf editor) and save their work
> either off- or online.
> when an object has been saved to the database, (other) users can download,
> edit and save the object as an XMI resource on their filesystem. after
> finishing their work, they can connect to the database (creating a new
> session for the transaction) and update the changes, and that's where the
> problem occurs: hibernate can't update the object in the db(using
> saveorupdate/merge) if it's already present. as i understand it, because
> the object has been saved locally in the meantime and cannot be associated
> to the object in the database anymore(despite of having the same class &
> id).
>
> we've been searching for a solution for this problem for quite a while now,
> finding a podcast on eclipsezone with ed merks in which he (unfortunately
> only for a minute)talked about sending a changedescription from client to
> server instead of the changed object itself. i tried to implement this
> but quickly found out that a changerecorder/description is rather meant
> to be used for an undo/redo command, since it only records the values
> before the changes.
>
> is there a good approach for our application? the only thing left i can
> think of is applying all changes "manually" online - but i believe there
> must be a better way.
>
> thanks in advance, chris


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Client/Server App with EMF and Teneo [message #595624 is a reply to message #61304] Tue, 14 November 2006 13:23 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
hi martin,

here's an example of an XMI resource i use:

-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<learningobjects:LearningUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:learningobjects="learningobjects.ecore" luFile="" id="learn-73339A20-7762-30F9-19C1-0E628D1ADDC7" timestamp="2006-11-12T17:04:45.258+0100">
<luMeta creationDate="0017-04-28T00:00:00.000+0100" id="leame-F3E3A044-7F3F-8EB7-009E-35BCB119DEB8" timestamp="2006-11-11T17:05:20.612+0100" defLang="deu">
<didacMeta title="mydidacmeta" keywords=""/>
<authors id="autho-847678C2-D4A6-A6A5-21EB-8B4576EAF36B" timestamp="2006-11-11T17:05:42.218+0100"/>
<publishInfo edition="myed" pubdate="2006-11-11" id="pubin-30C904BE-0806-0EEC-B42B-78E1AF6723AD" timestamp="2006-11-11T17:05:44.665+0100"/>
</luMeta>
<accessControl status="okeydokey my old okey">
<userauthorization/>
<editionHistory/>
</accessControl>
<item/>
</learningobjects:LearningUnit>
-----------------------

the 'id' attribute value is the same as for the db-persistet object.
when trying to use saveOrUpdate, i get the following exception.

----------------------------------
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [LearningUnit#learn-3F8E37AC-1D82-A875-CC6D-8CBFBB9EBDD0]
at org.hibernate.engine.StatefulPersistenceContext.checkUniquen ess(StatefulPersistenceContext.java:556)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:258)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
at org.hibernate.event.def.DefaultUpdateEventListener.performSa veOrUpdate(DefaultUpdateEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:5 59)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:547)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:539)
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:334)
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.persi stObject(DatabaseServices.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.xmlrpc.server.PropertyHandlerMapping$1.execute(Pr opertyHandlerMapping.java:141)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcSe rverWorker.java:43)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.j ava:65)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcSt reamServer.java:209)
at org.apache.xmlrpc.webserver.Connection.run(Connection.java:1 68)
at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
org.eclipse.emf.teneo.hibernate.HbStoreException: Exception when saving resource file:/D:/_dev/ATPrototyp/runtime-Authortool.0.3/TestLU.learn ingobjects in AuthortoolDataStore
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:356)
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.persi stObject(DatabaseServices.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.xmlrpc.server.PropertyHandlerMapping$1.execute(Pr opertyHandlerMapping.java:141)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcSe rverWorker.java:43)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.j ava:65)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcSt reamServer.java:209)
at org.apache.xmlrpc.webserver.Connection.run(Connection.java:1 68)
at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [LearningUnit#learn-3F8E37AC-1D82-A875-CC6D-8CBFBB9EBDD0]
at org.hibernate.engine.StatefulPersistenceContext.checkUniquen ess(StatefulPersistenceContext.java:556)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:258)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
at org.hibernate.event.def.DefaultUpdateEventListener.performSa veOrUpdate(DefaultUpdateEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:5 59)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:547)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:539)
at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:334)
... 12 more
----------------------------------

thx & greets, chris




On Tue, 14 Nov 2006 12:51:47 +0100 wrote Martin Taal:

> Hi Christian,
> The hibernateresource does saveOrUpdate which should do what you want (update the object in the
> database or create a new one). For this to work correctly (with client-server scenarios) you need to
> have an id and version property in your model.
>
> Do you get an exception when persisting the changes back?
>
> gr. Martin
>
Re: Client/Server App with EMF and Teneo [message #595632 is a reply to message #61328] Tue, 14 November 2006 13:43 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Chris,
How is it possible that there is already an object with the same id in the resource/session?

Can you describe the flow and the creation/use of the (hibernate)resource?

gr. Martin

Christian Donhofer wrote:
> hi martin,
>
> here's an example of an XMI resource i use:
>
> -----------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <learningobjects:LearningUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:learningobjects="learningobjects.ecore" luFile="" id="learn-73339A20-7762-30F9-19C1-0E628D1ADDC7" timestamp="2006-11-12T17:04:45.258+0100">
> <luMeta creationDate="0017-04-28T00:00:00.000+0100" id="leame-F3E3A044-7F3F-8EB7-009E-35BCB119DEB8" timestamp="2006-11-11T17:05:20.612+0100" defLang="deu">
> <didacMeta title="mydidacmeta" keywords=""/>
> <authors id="autho-847678C2-D4A6-A6A5-21EB-8B4576EAF36B" timestamp="2006-11-11T17:05:42.218+0100"/>
> <publishInfo edition="myed" pubdate="2006-11-11" id="pubin-30C904BE-0806-0EEC-B42B-78E1AF6723AD" timestamp="2006-11-11T17:05:44.665+0100"/>
> </luMeta>
> <accessControl status="okeydokey my old okey">
> <userauthorization/>
> <editionHistory/>
> </accessControl>
> <item/>
> </learningobjects:LearningUnit>
> -----------------------
>
> the 'id' attribute value is the same as for the db-persistet object.
> when trying to use saveOrUpdate, i get the following exception.
>
> ----------------------------------
> org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [LearningUnit#learn-3F8E37AC-1D82-A875-CC6D-8CBFBB9EBDD0]
> at org.hibernate.engine.StatefulPersistenceContext.checkUniquen ess(StatefulPersistenceContext.java:556)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:258)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
> at org.hibernate.event.def.DefaultUpdateEventListener.performSa veOrUpdate(DefaultUpdateEventListener.java:33)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
> at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:5 59)
> at org.hibernate.impl.SessionImpl.update(SessionImpl.java:547)
> at org.hibernate.impl.SessionImpl.update(SessionImpl.java:539)
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:334)
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.persi stObject(DatabaseServices.java:446)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.apache.xmlrpc.server.PropertyHandlerMapping$1.execute(Pr opertyHandlerMapping.java:141)
> at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcSe rverWorker.java:43)
> at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.j ava:65)
> at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcSt reamServer.java:209)
> at org.apache.xmlrpc.webserver.Connection.run(Connection.java:1 68)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
> org.eclipse.emf.teneo.hibernate.HbStoreException: Exception when saving resource file:/D:/_dev/ATPrototyp/runtime-Authortool.0.3/TestLU.learn ingobjects in AuthortoolDataStore
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:356)
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.persi stObject(DatabaseServices.java:446)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.apache.xmlrpc.server.PropertyHandlerMapping$1.execute(Pr opertyHandlerMapping.java:141)
> at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcSe rverWorker.java:43)
> at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.j ava:65)
> at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcSt reamServer.java:209)
> at org.apache.xmlrpc.webserver.Connection.run(Connection.java:1 68)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
> Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [LearningUnit#learn-3F8E37AC-1D82-A875-CC6D-8CBFBB9EBDD0]
> at org.hibernate.engine.StatefulPersistenceContext.checkUniquen ess(StatefulPersistenceContext.java:556)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:258)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
> at org.hibernate.event.def.DefaultUpdateEventListener.performSa veOrUpdate(DefaultUpdateEventListener.java:33)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
> at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:5 59)
> at org.hibernate.impl.SessionImpl.update(SessionImpl.java:547)
> at org.hibernate.impl.SessionImpl.update(SessionImpl.java:539)
> at jku.ce.scholion.authortool.dataaccess.DatabaseServices.saveR esource(DatabaseServices.java:334)
> ... 12 more
> ----------------------------------
>
> thx & greets, chris
>
>
>
>
> On Tue, 14 Nov 2006 12:51:47 +0100 wrote Martin Taal:
>
>> Hi Christian,
>> The hibernateresource does saveOrUpdate which should do what you want (update the object in the
>> database or create a new one). For this to work correctly (with client-server scenarios) you need to
>> have an id and version property in your model.
>>
>> Do you get an exception when persisting the changes back?
>>
>> gr. Martin
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Client/Server App with EMF and Teneo [message #595699 is a reply to message #61352] Wed, 15 November 2006 17:24 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
hi martin,

sorry i posted the wrong exception (using a wrong version of the
applicaton) last time.

I try to update the following object in the database:

<?xml version="1.0" encoding="UTF-8"?>
<lobj:LearningUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore" id="id-01" timestamp="2006-10-10T00:00:00.000+0200" luFile="asdsad">
<luMeta id="leame-95EE2680-9A22-4647-2B09-66413AB827D5" timestamp="2006-11-15T13:18:16.921+0100" creationDate="2006-12-12T00:00:00.000+0100">
<defLang href="Lang_de.learningobjects#de"/>
</luMeta>
<item luRef="sadasd">
<corrBlock>
<presentationBlock lod="2" rendering="PC">
<block xsi:type="lobj:HypertextBlock" href=" TestBlock.learningobjects#hyblo-42F36FDE-5CF6-FF93-3C9F-F5CB F5867B5D "/>
</presentationBlock>
<titleMeta title="mytitle">
<language href="Lang_de.learningobjects#de"/>
</titleMeta>
</corrBlock>
</item>
</lobj:LearningUnit>

The EObject "LearningUnit" already exists in the database and contains
several EObjects. For each EObject in the resource the "saveOrUpdate"
method is called. See the following code snippet:
---------------
tx = mySession.beginTransaction();
final List list = resource.getContents();
for (int i = 0; i < list.size(); i++) {
tObj = list.get(i);

mySession.saveOrUpdate(tObj);
}

// now flush everything
mySession.flush();
err = false;
---------------

Anyhow, it seems that the application tries to save each EObject as a new
one, beginning with the EObject "Language". here's the exception:

-------------------------------------------------

17:55:47,375 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
17:55:47,375 DEBUG SQL:346 - insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`) values (?, ?, 'Language', ?)
17:55:47,375 DEBUG AbstractBatcher:424 - preparing statement
17:55:47,390 DEBUG AbstractEntityPersister:1821 - Dehydrating entity: [Language#de]
17:55:47,390 DEBUG AbstractBatcher:28 - Adding to batch
17:55:47,390 DEBUG AbstractEntityPersister:2034 - Inserting entity: [LuMeta#leame-95EE2680-9A22-4647-2B09-66413AB827D5]
17:55:47,390 DEBUG AbstractEntityPersister:2035 - Version: 0
17:55:47,390 DEBUG AbstractBatcher:55 - Executing batch size: 1
17:55:47,390 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
17:55:47,390 DEBUG AbstractBatcher:470 - closing statement
17:55:47,390 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC batch update [insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`) values (?, ?, 'Language', ?)]
java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:91)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:86)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abs tractBatcher.java:171)
at org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2048)
[...]
at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
17:55:47,390 WARN JDBCExceptionReporter:71 - SQL Error: 1062, SQLState: 23000
17:55:47,406 ERROR JDBCExceptionReporter:72 - Duplicate entry 'de' for key 1
17:55:47,406 DEBUG DatabaseServices:304 - Exception in DatabaseServices.saveResource: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
17:55:47,406 DEBUG DatabaseServices:305 - --- Message: Could not execute JDBC batch update
17:55:47,421 ERROR HbStoreException:47 - Exception when saving resource file:/D:/_dev/ATPrototyp/runtime-Authortool.0.4/TestObjects/ TestLU.learningobjects in AuthortoolDataStore
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateCo nverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce ptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:202)
[...]
at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
Caused by: java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
at
com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
at
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
... 51 more
-------------------------------------------------

On Tue, 14 Nov 2006 14:43:14 +0100 wrote Martin Taal:

> Hi Chris,
> How is it possible that there is already an object with the same id in the resource/session?
>
> Can you describe the flow and the creation/use of the (hibernate)resource?
>
> gr. Martin
Re: Client/Server App with EMF and Teneo [message #595709 is a reply to message #61544] Wed, 15 November 2006 18:06 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
Can you send me the ecore? And an xml file with the data you try to persist (or a subset of it)?
Then I can test myself what happens.

gr. Martin

Christian Donhofer wrote:
> hi martin,
>
> sorry i posted the wrong exception (using a wrong version of the
> applicaton) last time.
>
> I try to update the following object in the database:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <lobj:LearningUnit xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lobj="lobj.ecore" id="id-01" timestamp="2006-10-10T00:00:00.000+0200" luFile="asdsad">
> <luMeta id="leame-95EE2680-9A22-4647-2B09-66413AB827D5" timestamp="2006-11-15T13:18:16.921+0100" creationDate="2006-12-12T00:00:00.000+0100">
> <defLang href="Lang_de.learningobjects#de"/>
> </luMeta>
> <item luRef="sadasd">
> <corrBlock>
> <presentationBlock lod="2" rendering="PC">
> <block xsi:type="lobj:HypertextBlock" href=" TestBlock.learningobjects#hyblo-42F36FDE-5CF6-FF93-3C9F-F5CB F5867B5D "/>
> </presentationBlock>
> <titleMeta title="mytitle">
> <language href="Lang_de.learningobjects#de"/>
> </titleMeta>
> </corrBlock>
> </item>
> </lobj:LearningUnit>
>
> The EObject "LearningUnit" already exists in the database and contains
> several EObjects. For each EObject in the resource the "saveOrUpdate"
> method is called. See the following code snippet:
> ---------------
> tx = mySession.beginTransaction();
> final List list = resource.getContents();
> for (int i = 0; i < list.size(); i++) {
> tObj = list.get(i);
>
> mySession.saveOrUpdate(tObj);
> }
>
> // now flush everything
> mySession.flush();
> err = false;
> ---------------
>
> Anyhow, it seems that the application tries to save each EObject as a new
> one, beginning with the EObject "Language". here's the exception:
>
> -------------------------------------------------
>
> 17:55:47,375 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
> 17:55:47,375 DEBUG SQL:346 - insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`) values (?, ?, 'Language', ?)
> 17:55:47,375 DEBUG AbstractBatcher:424 - preparing statement
> 17:55:47,390 DEBUG AbstractEntityPersister:1821 - Dehydrating entity: [Language#de]
> 17:55:47,390 DEBUG AbstractBatcher:28 - Adding to batch
> 17:55:47,390 DEBUG AbstractEntityPersister:2034 - Inserting entity: [LuMeta#leame-95EE2680-9A22-4647-2B09-66413AB827D5]
> 17:55:47,390 DEBUG AbstractEntityPersister:2035 - Version: 0
> 17:55:47,390 DEBUG AbstractBatcher:55 - Executing batch size: 1
> 17:55:47,390 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
> 17:55:47,390 DEBUG AbstractBatcher:470 - closing statement
> 17:55:47,390 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC batch update [insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`) values (?, ?, 'Language', ?)]
> java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
> at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
> at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
> at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:91)
> at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:86)
> at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abs tractBatcher.java:171)
> at org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2048)
> [...]
> at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
> 17:55:47,390 WARN JDBCExceptionReporter:71 - SQL Error: 1062, SQLState: 23000
> 17:55:47,406 ERROR JDBCExceptionReporter:72 - Duplicate entry 'de' for key 1
> 17:55:47,406 DEBUG DatabaseServices:304 - Exception in DatabaseServices.saveResource: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
> 17:55:47,406 DEBUG DatabaseServices:305 - --- Message: Could not execute JDBC batch update
> 17:55:47,421 ERROR HbStoreException:47 - Exception when saving resource file:/D:/_dev/ATPrototyp/runtime-Authortool.0.4/TestObjects/ TestLU.learningobjects in AuthortoolDataStore
> org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateCo nverter.java:71)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce ptionHelper.java:43)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:202)
> [...]
> at org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
> Caused by: java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
> at
> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
> at
> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
> at
> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
> ... 51 more
> -------------------------------------------------
>
> On Tue, 14 Nov 2006 14:43:14 +0100 wrote Martin Taal:
>
>> Hi Chris,
>> How is it possible that there is already an object with the same id in the resource/session?
>>
>> Can you describe the flow and the creation/use of the (hibernate)resource?
>>
>> gr. Martin


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Client/Server App with EMF and Teneo [message #595776 is a reply to message #61558] Thu, 16 November 2006 18:10 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------090804040307040001090309
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

hi martin,

all needed files are attached!

cheers, chris

Martin Taal wrote:
> Hi Christian,
> Can you send me the ecore? And an xml file with the data you try to
> persist (or a subset of it)?
> Then I can test myself what happens.
>
> gr. Martin
>
> Christian Donhofer wrote:
>
>> hi martin,
>>
>> sorry i posted the wrong exception (using a wrong version of the
>> applicaton) last time.
>>
>> I try to update the following object in the database:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <lobj:LearningUnit xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:lobj="lobj.ecore" id="id-01"
>> timestamp="2006-10-10T00:00:00.000+0200" luFile="asdsad">
>> <luMeta id="leame-95EE2680-9A22-4647-2B09-66413AB827D5"
>> timestamp="2006-11-15T13:18:16.921+0100"
>> creationDate="2006-12-12T00:00:00.000+0100">
>> <defLang href="Lang_de.learningobjects#de"/>
>> </luMeta>
>> <item luRef="sadasd">
>> <corrBlock>
>> <presentationBlock lod="2" rendering="PC">
>> <block xsi:type="lobj:HypertextBlock"
>> href=" TestBlock.learningobjects#hyblo-42F36FDE-5CF6-FF93-3C9F-F5CB F5867B5D "/>
>>
>> </presentationBlock>
>> <titleMeta title="mytitle">
>> <language href="Lang_de.learningobjects#de"/>
>> </titleMeta>
>> </corrBlock>
>> </item>
>> </lobj:LearningUnit>
>>
>> The EObject "LearningUnit" already exists in the database and contains
>> several EObjects. For each EObject in the resource the "saveOrUpdate"
>> method is called. See the following code snippet: ---------------
>> tx = mySession.beginTransaction();
>> final List list = resource.getContents();
>> for (int i = 0; i < list.size(); i++) {
>> tObj = list.get(i);
>>
>> mySession.saveOrUpdate(tObj);
>> }
>>
>> // now flush everything
>> mySession.flush();
>> err = false; ---------------
>>
>> Anyhow, it seems that the application tries to save each EObject as a new
>> one, beginning with the EObject "Language". here's the exception:
>>
>> -------------------------------------------------
>>
>> 17:55:47,375 DEBUG AbstractBatcher:311 - about to open
>> PreparedStatement (open PreparedStatements: 0, globally: 0)
>> 17:55:47,375 DEBUG SQL:346 - insert into `LANGUAGE` (vn, `LANGUAGE`,
>> `DTYPE`, `CODE`) values (?, ?, 'Language', ?)
>> 17:55:47,375 DEBUG AbstractBatcher:424 - preparing statement
>> 17:55:47,390 DEBUG AbstractEntityPersister:1821 - Dehydrating entity:
>> [Language#de]
>> 17:55:47,390 DEBUG AbstractBatcher:28 - Adding to batch
>> 17:55:47,390 DEBUG AbstractEntityPersister:2034 - Inserting entity:
>> [LuMeta#leame-95EE2680-9A22-4647-2B09-66413AB827D5]
>> 17:55:47,390 DEBUG AbstractEntityPersister:2035 - Version: 0
>> 17:55:47,390 DEBUG AbstractBatcher:55 - Executing batch size: 1
>> 17:55:47,390 DEBUG AbstractBatcher:319 - about to close
>> PreparedStatement (open PreparedStatements: 1, globally: 1)
>> 17:55:47,390 DEBUG AbstractBatcher:470 - closing statement
>> 17:55:47,390 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC
>> batch update [insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`)
>> values (?, ?, 'Language', ?)]
>> java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
>> at
>> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
>>
>> at
>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
>> at
>> org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:91)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:86)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abs tractBatcher.java:171)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2048)
>>
>> [...]
>> at
>> org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
>> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
>> 17:55:47,390 WARN JDBCExceptionReporter:71 - SQL Error: 1062,
>> SQLState: 23000
>> 17:55:47,406 ERROR JDBCExceptionReporter:72 - Duplicate entry 'de' for
>> key 1
>> 17:55:47,406 DEBUG DatabaseServices:304 - Exception in
>> DatabaseServices.saveResource:
>> org.hibernate.exception.ConstraintViolationException: Could not
>> execute JDBC batch update
>> 17:55:47,406 DEBUG DatabaseServices:305 - --- Message: Could not
>> execute JDBC batch update
>> 17:55:47,421 ERROR HbStoreException:47 - Exception when saving
>> resource
>> file:/D:/_dev/ATPrototyp/runtime-Authortool.0.4/TestObjects/ TestLU.learningobjects
>> in AuthortoolDataStore
>> org.hibernate.exception.ConstraintViolationException: Could not
>> execute JDBC batch update
>> at
>> org.hibernate.exception.SQLStateConverter.convert(SQLStateCo nverter.java:71)
>>
>> at
>> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce ptionHelper.java:43)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:202)
>> [...]
>> at
>> org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
>> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
>> Caused by: java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
>> at
>> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
>>
>> at
>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
>>
>> at
>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
>>
>> ... 51 more
>> -------------------------------------------------
>>
>> On Tue, 14 Nov 2006 14:43:14 +0100 wrote Martin Taal:
>>
>>> Hi Chris,
>>> How is it possible that there is already an object with the same id
>>> in the resource/session?
>>>
>>> Can you describe the flow and the creation/use of the
>>> (hibernate)resource?
>>>
>>> gr. Martin
>
>
>


--------------090804040307040001090309
Content-Type: application/zip;
name="TestObjects.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="TestObjects.zip"

UEsDBBQAAAAIAK6ObzXQcKxoiAAAAKQAAAAXAAAATGFuZ19kZS5sZWFybmlu Z29iamVjdHM9
jsEKAiEQhu9B7yBzT6tTyNpeIgjqVtB1cwfXcJ1QN/fxU6guP8ww3zd/086j Y28M0ZJXsOFr
YOg19dYbBbfrcbWDdr9cNI4eT3nuvJk6g2werfxD2woVjY+y7BUMKb2kEDln TqPhFIy4X06/
kypSUJOjpoDA3Neq4IBTinoAVgqUsUcQ5fcHUEsDBBQAAAAIAK6ObzV+rpLK ywEAAHsDAAAZ
AAAAVGVzdEJsb2NrLmxlYXJuaW5nb2JqZWN0c5VTy66bMBDdV+o/WO7yymAD 5qWkV4nBaqVm
l0rdVQ5MElqwI3Cb5O9rSMji6vYlGeQZzZwzc2a8eL50LfoJ/dAYvcTMoxiB rkzd6MMSf95K
kuLn92/fLFqz+5Z/uJ6gt3Cx69ZU39Gla/JHajCmOjA95M6/xEdrT7nvn89n z3QHz/QH/8vm
4xwywi3x+PegMj1g1NQu57prDYkCGcayKAkXMiZSZiEJRSaJ5GIteRona15g ZJsOBqu6k6Om
NCaMEca3LMwZz3nkBTF/ooxS7IpHaLEbC96AVROPszogNC2yQKwiEhRyRVjE MxImq5JkXBS0
yFiUpKs/8cQ5TbwkZTce1BqHHGDUg66hn/Q7VRhVPSjrFCqUhRmCurOlNJ+O Ryl9osEEoQa7
cdrvG6inWP7b2Kkt19jQdKcWiqZW1dSebWzreO6XOcwFtkoffqgDoGMP+yX+ 5MyvNXgtqF67
Yt0koLLDuxqwP2P7L8Bnfw37Mf1fkRb+Q/2bfZzXSBhtQdv77CujScmjgIlQ kDRJIpJJJohM
I0aKOEpEmaTrshR/mX3iUXafPTqCum2y0tfZcCO50Y57oNAr30Pc/9Vs4b9s bXw6/itvx/l/
AVBLAwQUAAAACACujm81lgGOd90BAABqAwAAFgAAAFRlc3RMVS5sZWFybmlu Z29iamVjdHON
U9uK2zAQfS/0H4z6uMiW5NiJTdxlczFdyELpZqFvRWvPJmplOchKk/x9x8ql ZNOHgjCjmTMz
Z85Y4/t9o4PfYDvVmoLwkJEATNXWyqwK8rIs6Yjcf/74Yazb15/5AqQ1GHkx ygX7RuWXRNEn
YinT5egvyNq5TR5Fu90ubJtV2NpV9P3p8QLpriG72CMEYxxhi+dqDY2kynRO mgrOWT2FgvTf
EKrWol/VBVE1ZZwETjWA8GaDXBhLKWd4lozl/oSMsTuGARLobak0FER2dSdr grMFwVhvn8BJ
X0+DbIBmyXwu0hGj2YMQdJAOhlRMWEbTdMDjh8lIDGfJP5pyypMlj3M+ynka ZoLfMd43rSxI
h0LNpIMzVuB5R7DHekJIqYa3hTSrYG3hrSC9+aOGUJ82gCJA5bpPNZDoOEJ0 nOF4UQ4anPRb
n4pT4qyXuqicnei2+nVyoGtjoQPjPEMfCnSLSggSWDA1WP8vfJ2SSwbmvHoc LjJ3hw0c15J/
QdM62DtfhZy4L1Ej77hhvz5gGToQZZyWszlNpmVKyzKLaTzNSlom00mZjNLh JJmdpvStoxu+
f2NOOQ1+l94qSHPwxhV3jWJu5Qr+V9tj10vps5LRtZTjqFe9fyvRzWNB7x9Q SwECFAAUAAAA
CACujm810HCsaIgAAACkAAAAFwAAAAAAAAABACAAAAAAAAAATGFuZ19kZS5s ZWFybmluZ29i
amVjdHNQSwECFAAUAAAACACujm81fq6SyssBAAB7AwAAGQAAAAAAAAABACAA AAC9AAAAVGVz
dEJsb2NrLmxlYXJuaW5nb2JqZWN0c1BLAQIUABQAAAAIAK6ObzWWAY533QEA AGoDAAAWAAAA
AAAAAAEAIAAAAL8CAABUZXN0TFUubGVhcm5pbmdvYmplY3RzUEsFBgAAAAAD AAMA0AAAANAE
AAAAAA==
--------------090804040307040001090309
Content-Type: text/xml;
name="lobj.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="lobj.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="lobj"
nsURI="lobj.ecore" nsPrefix="lobj">
<eClassifiers xsi:type="ecore:EClass" name="LearningObject" abstract="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="learningObject"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" unique="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//ID" iD="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="id"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="timestamp" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="timestamp"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="synchronized" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="synchronized"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Block" abstract="true" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="block"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="blockMeta" lowerBound="1"
eType="#//BlockMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="blockMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="externalMetadata"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="source" eType="#//Source"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="source"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="HypertextBlock" eSuperTypes="#//Block">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="hypertextBlock"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="hypertextContent" upperBound="-1"
eType="#//HypertextContent" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="hypertextContent"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractContent" abstract="true" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="abstractContent"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="heading" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="heading"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="language" eType="#//Language"
resolveProxies="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="language"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="HypertextContent" eSuperTypes="#//AbstractContent">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="hypertextContent"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="content" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="content"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="blockAudiofile" eType="#//blockAudiofile"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="blockAudiofile"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="resrcFile" upperBound="-1"
eType="#//ResrcFile" eOpposite="#//ResrcFile/hypertextContent">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="resrcFile"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="BlockFolder" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="blockFolder"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
eType="#//FolderMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="folderMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="blockFolder" upperBound="-1"
eType="#//BlockFolder" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="blockFolder"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="block" upperBound="-1"
eType="#//Block" containment="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="block"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Category" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="category"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="titleMeta" upperBound="-1"
eType="#//TitleMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="categoryDidacMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="course" upperBound="-1"
eType="#//Course" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="course"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="CorrBlock">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="corrBlock"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="presentationBlock" upperBound="-1"
eType="#//PresentationBlock" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="presentationBlock"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="titleMeta" upperBound="-1"
eType="#//TitleMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="categoryDidacMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Course" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="course"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="courseMeta" lowerBound="1"
eType="#//CourseMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="courseMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="externalMetadata"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="coursetype" eType="#//Coursetype">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="coursetype"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="outlineAsXml" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="outlineAsXml"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="module" upperBound="-1"
eType="#//Module"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Item">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="item"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="corrBlock" upperBound="-1"
eType="#//CorrBlock" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="corrBlock"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="childitems" upperBound="-1"
eType="#//Item" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="item"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="luRef" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LearningUnit" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="learningUnit"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="luMeta" lowerBound="1"
eType="#//LuMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="luMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="externalMetadata"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="treeAsXml" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="treeAsXml"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="luFile" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="luFile"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//Item"
containment="true" resolveProxies="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LuFolder" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="luFolder"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
eType="#//FolderMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="folderMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="luFolder" upperBound="-1"
eType="#//LuFolder" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="luFolder"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="learningUnit" upperBound="-1"
eType="#//LearningUnit" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="learningUnit"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Module" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="module"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="moduleMeta" lowerBound="1"
eType="#//ModuleMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="moduleMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="externalMetadata"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="rootNode" eType="#//Node"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="rootNode"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="moduleFile" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="moduleFile"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="treeAsXml" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="treeAsXml"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ModuleFolder" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="moduleFolder"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
eType="#//FolderMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="folderMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="moduleFolder" upperBound="-1"
eType="#//ModuleFolder" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="moduleFolder"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="module" upperBound="-1"
eType="#//Module" containment="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="module"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ResrcFolder" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="resrcFolder"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
eType="#//FolderMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="folderMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="resrcFolder" upperBound="-1"
eType="#//ResrcFolder" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="resrcFolder"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteScheduled" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="deleteScheduled"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="resrcFile" upperBound="-1"
eType="#//ResrcFile" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="resrcFile"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotation.elver.org/Indexed">
<details key="value" value="false"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Theme" eSuperTypes="#//LearningObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="theme"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="simpleDidacMeta" upperBound="-1"
eType="#//SimpleDidacMeta" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="simpleDidacMeta"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
<eAnnotations source="http://annotati
Re: Client/Server App with EMF and Teneo [message #595896 is a reply to message #61730] Sat, 18 November 2006 06:13 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020108020703090309000804
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Christian,
I tested it. This occurs because the types do not have an explicit version efeature in the ecore model.
If a type does not have a version property then teneo will add a so-called synthetic version
property in the hibernate mapping. When an object is saved or loaded then the version is maintained
in a cache by Teneo. This is a weakreference cache which means that if the object is
garbage-collected that the version information is removed, also the cache works with object (memory
equality). For example the version info is removed when your object is sent to the client (and
leaves the server in a way).
When the object then gets back from the client the version information is not present in the cache
anymore and hibernate will think that no version is set and therefor that it is a new object.

To solve this you need to add to each type a version eattribute. As an example I have added one to
Language (see attached ecore), the xmi test file then also needs it.

I will add a separate section on elver.org to highlight that for client-server scenarios you need
explicit version and id properties. It is partially mentioned here:
http://www.elver.org/hibernate/hibernate_details.html#Synthe tic+ID+and+Version+properties
but this is not clear enough.

gr. Martin

Christian Donhofer wrote:
> hi martin,
>
> all needed files are attached!
>
> cheers, chris
>
> Martin Taal wrote:
>> Hi Christian,
>> Can you send me the ecore? And an xml file with the data you try to
>> persist (or a subset of it)?
>> Then I can test myself what happens.
>>
>> gr. Martin
>>
>> Christian Donhofer wrote:
>>
>>> hi martin,
>>>
>>> sorry i posted the wrong exception (using a wrong version of the
>>> applicaton) last time.
>>>
>>> I try to update the following object in the database:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <lobj:LearningUnit xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:lobj="lobj.ecore" id="id-01"
>>> timestamp="2006-10-10T00:00:00.000+0200" luFile="asdsad">
>>> <luMeta id="leame-95EE2680-9A22-4647-2B09-66413AB827D5"
>>> timestamp="2006-11-15T13:18:16.921+0100"
>>> creationDate="2006-12-12T00:00:00.000+0100">
>>> <defLang href="Lang_de.learningobjects#de"/>
>>> </luMeta>
>>> <item luRef="sadasd">
>>> <corrBlock>
>>> <presentationBlock lod="2" rendering="PC">
>>> <block xsi:type="lobj:HypertextBlock"
>>> href=" TestBlock.learningobjects#hyblo-42F36FDE-5CF6-FF93-3C9F-F5CB F5867B5D "/>
>>>
>>> </presentationBlock>
>>> <titleMeta title="mytitle">
>>> <language href="Lang_de.learningobjects#de"/>
>>> </titleMeta>
>>> </corrBlock>
>>> </item>
>>> </lobj:LearningUnit>
>>>
>>> The EObject "LearningUnit" already exists in the database and contains
>>> several EObjects. For each EObject in the resource the "saveOrUpdate"
>>> method is called. See the following code snippet: ---------------
>>> tx = mySession.beginTransaction();
>>> final List list = resource.getContents();
>>> for (int i = 0; i < list.size(); i++) {
>>> tObj = list.get(i);
>>>
>>> mySession.saveOrUpdate(tObj);
>>> }
>>>
>>> // now flush everything
>>> mySession.flush();
>>> err = false; ---------------
>>>
>>> Anyhow, it seems that the application tries to save each EObject as a new
>>> one, beginning with the EObject "Language". here's the exception:
>>>
>>> -------------------------------------------------
>>>
>>> 17:55:47,375 DEBUG AbstractBatcher:311 - about to open
>>> PreparedStatement (open PreparedStatements: 0, globally: 0)
>>> 17:55:47,375 DEBUG SQL:346 - insert into `LANGUAGE` (vn, `LANGUAGE`,
>>> `DTYPE`, `CODE`) values (?, ?, 'Language', ?)
>>> 17:55:47,375 DEBUG AbstractBatcher:424 - preparing statement
>>> 17:55:47,390 DEBUG AbstractEntityPersister:1821 - Dehydrating entity:
>>> [Language#de]
>>> 17:55:47,390 DEBUG AbstractBatcher:28 - Adding to batch
>>> 17:55:47,390 DEBUG AbstractEntityPersister:2034 - Inserting entity:
>>> [LuMeta#leame-95EE2680-9A22-4647-2B09-66413AB827D5]
>>> 17:55:47,390 DEBUG AbstractEntityPersister:2035 - Version: 0
>>> 17:55:47,390 DEBUG AbstractBatcher:55 - Executing batch size: 1
>>> 17:55:47,390 DEBUG AbstractBatcher:319 - about to close
>>> PreparedStatement (open PreparedStatements: 1, globally: 1)
>>> 17:55:47,390 DEBUG AbstractBatcher:470 - closing statement
>>> 17:55:47,390 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC
>>> batch update [insert into `LANGUAGE` (vn, `LANGUAGE`, `DTYPE`, `CODE`)
>>> values (?, ?, 'Language', ?)]
>>> java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
>>> at
>>> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
>>>
>>> at
>>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:91)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract Batcher.java:86)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abs tractBatcher.java:171)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2048)
>>>
>>> [...]
>>> at
>>> org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
>>> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
>>> 17:55:47,390 WARN JDBCExceptionReporter:71 - SQL Error: 1062,
>>> SQLState: 23000
>>> 17:55:47,406 ERROR JDBCExceptionReporter:72 - Duplicate entry 'de' for
>>> key 1
>>> 17:55:47,406 DEBUG DatabaseServices:304 - Exception in
>>> DatabaseServices.saveResource:
>>> org.hibernate.exception.ConstraintViolationException: Could not
>>> execute JDBC batch update
>>> 17:55:47,406 DEBUG DatabaseServices:305 - --- Message: Could not
>>> execute JDBC batch update
>>> 17:55:47,421 ERROR HbStoreException:47 - Exception when saving
>>> resource
>>> file:/D:/_dev/ATPrototyp/runtime-Authortool.0.4/TestObjects/ TestLU.learningobjects
>>> in AuthortoolDataStore
>>> org.hibernate.exception.ConstraintViolationException: Could not
>>> execute JDBC batch update
>>> at
>>> org.hibernate.exception.SQLStateConverter.convert(SQLStateCo nverter.java:71)
>>>
>>> at
>>> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce ptionHelper.java:43)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:202)
>>> [...]
>>> at
>>> org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPoo l.java:71)
>>> at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.ja va:87)
>>> Caused by: java.sql.BatchUpdateException: Duplicate entry 'de' for key 1
>>> at
>>> com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPr eparedStatement.java:648)
>>>
>>> at
>>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBa tcher.java:58)
>>>
>>> at
>>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatc her.java:195)
>>>
>>> ... 51 more
>>> -------------------------------------------------
>>>
>>> On Tue, 14 Nov 2006 14:43:14 +0100 wrote Martin Taal:
>>>
>>>> Hi Chris,
>>>> How is it possible that there is already an object with the same id
>>>> in the resource/session?
>>>>
>>>> Can you describe the flow and the creation/use of the
>>>> (hibernate)resource?
>>>>
>>>> gr. Martin
>>
>>
>
>
> ------------------------------------------------------------ ------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="lobj"
> nsURI="lobj.ecore" nsPrefix="lobj">
> <eClassifiers xsi:type="ecore:EClass" name="LearningObject" abstract="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="learningObject"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" unique="false" lowerBound="1"
> eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//ID" iD="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="id"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="timestamp" unique="false"
> lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="timestamp"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="synchronized" unique="false"
> lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="synchronized"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Block" abstract="true" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="block"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="blockMeta" lowerBound="1"
> eType="#//BlockMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="blockMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
> upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="externalMetadata"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="source" eType="#//Source"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="source"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="HypertextBlock" eSuperTypes="#//Block">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="hypertextBlock"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="hypertextContent" upperBound="-1"
> eType="#//HypertextContent" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="hypertextContent"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="AbstractContent" abstract="true" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="abstractContent"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="heading" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="heading"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="language" eType="#//Language"
> resolveProxies="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="language"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="HypertextContent" eSuperTypes="#//AbstractContent">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="hypertextContent"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="content" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="content"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="blockAudiofile" eType="#//blockAudiofile"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="blockAudiofile"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="resrcFile" upperBound="-1"
> eType="#//ResrcFile" eOpposite="#//ResrcFile/hypertextContent">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="resrcFile"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="BlockFolder" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="blockFolder"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
> eType="#//FolderMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="folderMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="blockFolder" upperBound="-1"
> eType="#//BlockFolder" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="blockFolder"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="block" upperBound="-1"
> eType="#//Block" containment="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="block"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Category" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="category"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="titleMeta" upperBound="-1"
> eType="#//TitleMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="categoryDidacMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="course" upperBound="-1"
> eType="#//Course" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="course"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="CorrBlock">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="corrBlock"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="presentationBlock" upperBound="-1"
> eType="#//PresentationBlock" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="presentationBlock"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="titleMeta" upperBound="-1"
> eType="#//TitleMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="categoryDidacMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Course" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="course"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="courseMeta" lowerBound="1"
> eType="#//CourseMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="courseMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
> upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="externalMetadata"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="coursetype" eType="#//Coursetype">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="coursetype"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="outlineAsXml" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="outlineAsXml"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="module" upperBound="-1"
> eType="#//Module"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Item">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="item"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="corrBlock" upperBound="-1"
> eType="#//CorrBlock" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="corrBlock"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="childitems" upperBound="-1"
> eType="#//Item" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="item"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="luRef" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="LearningUnit" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="learningUnit"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="luMeta" lowerBound="1"
> eType="#//LuMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="luMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
> upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="externalMetadata"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="treeAsXml" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="treeAsXml"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="luFile" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="luFile"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//Item"
> containment="true" resolveProxies="false"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="LuFolder" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="luFolder"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
> eType="#//FolderMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="folderMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="luFolder" upperBound="-1"
> eType="#//LuFolder" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="luFolder"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="learningUnit" upperBound="-1"
> eType="#//LearningUnit" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="learningUnit"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Module" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="module"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="moduleMeta" lowerBound="1"
> eType="#//ModuleMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="moduleMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="externalMetadata" ordered="false"
> upperBound="-1" eType="#//ExternalMetadata" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="externalMetadata"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="rootNode" eType="#//Node"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="rootNode"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="moduleFile" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="moduleFile"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="treeAsXml" unique="false"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="treeAsXml"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="ModuleFolder" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="moduleFolder"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
> eType="#//FolderMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="folderMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="moduleFolder" upperBound="-1"
> eType="#//ModuleFolder" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="moduleFolder"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="module" upperBound="-1"
> eType="#//Module" containment="true">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="module"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="ResrcFolder" eSuperTypes="#//LearningObject">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="resrcFolder"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="folderMeta" lowerBound="1"
> eType="#//FolderMeta" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="folderMeta"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="resrcFolder" upperBound="-1"
> eType="#//ResrcFolder" containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="resrcFolder"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> <eAnnotations source="http://annotation.elver.org/Indexed">
> <details key="value" value="false"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" eType="#//AccessControl"
> containment="true" resolveProxies="false">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="accessControl"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteScheduled" unique="false"
> lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="attribute"/>
> <details key="name" value="deleteScheduled"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore
Re: Client/Server App with EMF and Teneo [message #595972 is a reply to message #62094] Mon, 20 November 2006 15:50 Go to previous message
Christian Donhofer is currently offline Christian DonhoferFriend
Messages: 94
Registered: July 2009
Member
hi martin,

it's working!

thx alot, chris
Previous Topic:Teneo: HibernateResource is not smart enough
Next Topic:CDO and SessionInvalidationListener
Goto Forum:
  


Current Time: Fri Mar 29 01:19:41 GMT 2024

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

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

Back to the top