Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] [HibernateStore](Could not activate TCPClientConnector in CDO UI view)
[CDO] [HibernateStore] [message #1018469] Wed, 13 March 2013 21:53 Go to next message
franck T is currently offline franck TFriend
Messages: 3
Registered: March 2013
Junior Member
Hi,

Starting from org.eclipse.emf.cdo.examples.hibernate.server (4.1.0.v20120911-1146) I set up a CDO server. I work with mysql 5.0 RDB, generated_hbm.xml with my owns models. I follow the "wiki.eclipse.org/CDO_Hibernate_Stor" and the documentation pointers in it. This server starts without error.

I'm now trying to use my CDO ui view (based on org.eclipse.emf.cdo.ui (4.1.0.v20120821-1005) with a CDO store type = "hibernate". Each time I' m trying to connect on tcp-localhost , repo1 I get a :'Could not activate TCPClientConnector[localhost:2 036]'. I saw the post "eclipse.org/forums/index.php/m/924162/" and I verify my server config but I could not see what i miss.

This view works fine with a CDO store type="db" with another mysql scheme.
This is my server config :
<?xml version="1.0" encoding="UTF-8"?>
<cdoServer>

	<!--
	<acceptor type="http"/>
	-->

	<acceptor type="tcp" listenAddr="0.0.0.0" port="2036">
		<!--
		<negotiator type="challenge" description="/temp/users.db"/>
		-->
	</acceptor>

	<repository name="repo1">
		<!--
		<property name="overrideUUID" value=""/>
		<property name="supportingAudits" value="false"/>
		-->
		
		<property name="overrideUUID" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f"/>
		<property name="supportingAudits" value="false"/>
		<property name="supportingBranches" value="false"/>

		<initialPackage nsURI="noLink//model1/1.0"/>
		<initialPackage nsURI="noLink//model/model2.ecore"/>
		<initialPackage nsURI="noLink//model/model3.ecore"/>
		<initialPackage nsURI="noLink//model/model4.ecore"/>
		
		
		<!--
			NOTE: the following properties are currently defined on repository level.
			In future builds of the CDO Hibernate store these properties are defined
			within the store and mappingProvider tags.
		-->

			<!--
				Teneo options:
				see: noLink//www.elver.org/hibernate/options.html
				or the org.eclipse.emf.teneo.PersistenceOptions class
			-->

			<!-- The following value must be set normally like this, use this in your app also -->
			<property name="teneo.mapping.cascade_policy_on_non_containment" value="PERSIST,MERGE"/>

			<!-- some demo settings -->
			<!--
				using an external xml file for annotations, note this xml file
				is located in the org.eclipse.emf.cdo.examples.hibernate.annotations
				which is available on the cdo server by adding it to the CDOHibernateServer.launch configuration
			<property name="teneo.mapping.persistence_xml" value="/META-INF/company_model_teneo_annotations.xml"/>
			-->
			<!-- create tables for each subclass with joining to the parent table -->
			<property name="teneo.mapping.inheritance" value="JOINED"/>
			<!-- create an index for each fk -->
			<property name="teneo.mapping.add_index_for_fk" value="true"/>


			<!-- Hibernate properties , see: noLink//docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional -->
			<property name="hibernate.hbm2ddl.auto" value="update"/>
			<property name="hibernate.show_sql" value="true"/>
			<property name="hibernate.connection.pool_size" value="10"/>
			<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>


			<!-- Setting for mysql
			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
			-->
			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
			<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
			<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/cdohibernate"/>
			<property name="hibernate.connection.username" value="root"/>
			<property name="hibernate.connection.password" value="adminadmin"/>
		<store type="hibernate">
			<!-- 
			<mappingProvider type="teneo">
			</mappingProvider>
			 -->
			<mappingProvider type="file">
				<mappingFile location="/config/generated_hbm.xml"/>
			</mappingProvider>
		</store>
	</repository>

</cdoServer>


I guess that the hibernate cdo server do not allow connection but I can't understand why... Can anybody point me where I am going wrong (I still consider myself a newby )?

Thanks in advance.

Franck
Re: [CDO] [HibernateStore] [message #1018611 is a reply to message #1018469] Thu, 14 March 2013 07:29 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Franck,
There must be some other exception occuring at the server side 'underneath' the could not activate message. You don't
see any exception traces in the server log?

Are the tables created in the database?

Can you try without an explicitly generated hbm.xml file? (and removing the related option from the config)
Most people don't to have a generated hbm, it works fine with Teneo generating the mapping in-memory.
The only reason to use a generated hbm file is to do extensive customization of the generated hbm afterwards, this
hardly every is needed.


gr. Martin

On 03/14/2013 02:14 AM, franck T wrote:
> Hi,
> Starting from org.eclipse.emf.cdo.examples.hibernate.server (4.1.0.v20120911-1146) I set up a CDO server. I work with
> mysql 5.0 RDB, generated_hbm.xml with my owns models. I follow the "wiki.eclipse.org/CDO_Hibernate_Stor" and the
> documentation pointers in it. This server starts without error.
>
> I'm now trying to use my CDO ui view (based on org.eclipse.emf.cdo.ui (4.1.0.v20120821-1005) with a CDO store type =
> "hibernate". Each time I' m trying to connect on tcp-localhost , repo1 I get a :'Could not activate
> TCPClientConnector[localhost:2 036]'. I saw the post "eclipse.org/forums/index.php/m/924162/" and I verify my server
> config but I could not see what i miss.
> This view works fine with a CDO store type="db" with another mysql scheme.
> This is my server config :
> <?xml version="1.0" encoding="UTF-8"?>
> <cdoServer>
>
> <!--
> <acceptor type="http"/>
> -->
>
> <acceptor type="tcp" listenAddr="0.0.0.0" port="2036">
> <!--
> <negotiator type="challenge" description="/temp/users.db"/>
> -->
> </acceptor>
>
> <repository name="repo1">
> <!--
> <property name="overrideUUID" value=""/>
> <property name="supportingAudits" value="false"/>
> -->
>
> <property name="overrideUUID" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f"/>
> <property name="supportingAudits" value="false"/>
> <property name="supportingBranches" value="false"/>
>
> <initialPackage nsURI="noLink//model1/1.0"/>
> <initialPackage nsURI="noLink//model/model2.ecore"/>
> <initialPackage nsURI="noLink//model/model3.ecore"/>
> <initialPackage nsURI="noLink//model/model4.ecore"/>
>
>
> <!--
> NOTE: the following properties are currently defined on repository level.
> In future builds of the CDO Hibernate store these properties are defined
> within the store and mappingProvider tags.
> -->
>
> <!--
> Teneo options:
> see: noLink//www.elver.org/hibernate/options.html
> or the org.eclipse.emf.teneo.PersistenceOptions class
> -->
>
> <!-- The following value must be set normally like this, use this in your app also -->
> <property name="teneo.mapping.cascade_policy_on_non_containment" value="PERSIST,MERGE"/>
>
> <!-- some demo settings -->
> <!--
> using an external xml file for annotations, note this xml file
> is located in the org.eclipse.emf.cdo.examples.hibernate.annotations
> which is available on the cdo server by adding it to the CDOHibernateServer.launch configuration
> <property name="teneo.mapping.persistence_xml" value="/META-INF/company_model_teneo_annotations.xml"/>
> -->
> <!-- create tables for each subclass with joining to the parent table -->
> <property name="teneo.mapping.inheritance" value="JOINED"/>
> <!-- create an index for each fk -->
> <property name="teneo.mapping.add_index_for_fk" value="true"/>
>
>
> <!-- Hibernate properties , see:
> noLink//docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional -->
> <property name="hibernate.hbm2ddl.auto" value="update"/>
> <property name="hibernate.show_sql" value="true"/>
> <property name="hibernate.connection.pool_size" value="10"/>
> <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
>
>
> <!-- Setting for mysql
> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
> -->
> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/cdohibernate"/>
> <property name="hibernate.connection.username" value="root"/>
> <property name="hibernate.connection.password" value="adminadmin"/>
> <store type="hibernate">
> <!-- <mappingProvider type="teneo">
> </mappingProvider>
> -->
> <mappingProvider type="file">
> <mappingFile location="/config/generated_hbm.xml"/>
> </mappingProvider>
> </store>
> </repository>
>
> </cdoServer>
>
> I guess that the hibernate cdo server do not allow connection but I can't understand why... Can anybody point me where I
> am going wrong (I still consider myself a newby )?
>
> Thanks in advance.
>
> Franck


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [CDO] [HibernateStore] [message #1018656 is a reply to message #1018611] Thu, 14 March 2013 09:07 Go to previous messageGo to next message
franck T is currently offline franck TFriend
Messages: 3
Registered: March 2013
Junior Member
Hi, Martin,

first, thanks for your rapid answer.

I finaly found a solution :
Now i start the server without using the launch config of the plugin and use my own configuration using information in this topic :[CDO] Error while committing the transaction [message #892970]. I then add a path on the log4j properties and I could open a session in my CDO view.

Anyway I answer to your questions :
>There must be some other exception occuring at the server side 'underneath' the could not activate message. You don't
>see any exception traces in the server log?
I don't see any other exception in the log or even if I activate tracing in launch configuration.
>Are the tables created in the database?
Yes the tables were created, that is why I think about a connection problem between CDO view client and CDO hibernate store. At this point I don't really understand why it's working now.

>Can you try without an explicitly generated hbm.xml file? (and removing the related option from the config)
I tried this and a solution on an other post using a negociator but I had the same behavior... timeout waiting connection after 10 seconds.

>Most people don't to have a generated hbm, it works fine with Teneo generating the mapping in-memory.
>The only reason to use a generated hbm file is to do extensive customization of the generated hbm afterwards, this
>hardly every is needed.

In fact I want to use generated hbm because I need to optimize my RDB scheme. I have to deal with a model with more than 900 data types and 100.000.000 objects instances (at the begining). The Db store works fine for me at the begining, but when I start "loading stress" the performance problem rises.
In most case my "big data" are oredered containment list. I saw in db store that those lists were map to 2 tables : one for association and one for entries. When I look in sql log, I saw that this way leads to send to RDB server 2 inserts : one for association table and one for entry. In my case I'd like to cut the number of insert by 2 using only one table. I perhaps have to optimize again this scheme so that's why I use generated hbm.

With Regards, Franck
Re: [CDO] [HibernateStore] [message #1018701 is a reply to message #1018656] Thu, 14 March 2013 10:29 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Franck,
Ok, also not sure why it works now, but if it works it works :-).

For the hibernate store, you can also do quite some customization using jpa annotations in the model itself.

For containment associations the hb store won't use a join table normally, but you can control this using a @JoinTable
association. Also if ordering within the list is not important you can use an idbag mapping. See the relevant hibernate
documentation, the IdBag annotation or the idbag related persistence option:
http://wiki.eclipse.org/Teneo/Hibernate/Configuration_Options

Note the hibernate store does not yet support doing chunked reads of large lists, but this is a todo. So if it is
important to you please enter a bugzilla and I will solve/add it.

gr. Martin

On 03/14/2013 10:07 AM, franck T wrote:
> Hi, Martin,
>
> first, thanks for your rapid answer.
>
> I finaly found a solution : Now i start the server without using the launch config of the plugin and use my own
> configuration using information in this topic :[CDO] Error while committing the transaction [message #892970]. I then
> add a path on the log4j properties and I could open a session in my CDO view.
>
> Anyway I answer to your questions :
>> There must be some other exception occuring at the server side 'underneath' the could not activate message. You don't
>> see any exception traces in the server log?
> I don't see any other exception in the log or even if I activate tracing in launch configuration.
>> Are the tables created in the database?
> Yes the tables were created, that is why I think about a connection problem between CDO view client and CDO hibernate
> store. At this point I don't really understand why it's working now.
>
>> Can you try without an explicitly generated hbm.xml file? (and removing the related option from the config)
> I tried this and a solution on an other post using a negociator but I had the same behavior... timeout waiting
> connection after 10 seconds.
>
>> Most people don't to have a generated hbm, it works fine with Teneo generating the mapping in-memory.
>> The only reason to use a generated hbm file is to do extensive customization of the generated hbm afterwards, this
>> hardly every is needed.
>
> In fact I want to use generated hbm because I need to optimize my RDB scheme. I have to deal with a model with more than
> 900 data types and 100.000.000 objects instances (at the begining). The Db store works fine for me at the begining, but
> when I start "loading stress" the performance problem rises. In most case my "big data" are oredered containment list. I
> saw in db store that those lists were map to 2 tables : one for association and one for entries. When I look in sql log,
> I saw that this way leads to send to RDB server 2 inserts : one for association table and one for entry. In my case I'd
> like to cut the number of insert by 2 using only one table. I perhaps have to optimize again this scheme so that's why I
> use generated hbm.
>
> With Regards, Franck


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Persisting a complete model into one file
Next Topic:[CDO] Possible bug in CDORepositorySynchronizer?
Goto Forum:
  


Current Time: Fri Mar 29 02:24:24 GMT 2024

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

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

Back to the top