[hibernate-dev] [OGM-122] Cassandra integration and hibernate-core version

2012-03-25 Thread kmx.pet...@gmail.com
Hi,

I am trying to integrate Cassandra into Hibernate OGM (cf. issue 
OGM-122) and as I am a noob, I have some noob questions...

Presently, the current version of Hibernate OGM is using the version 
4.0.1-Final of Hibernate core but this version seems to call twice the 
start method from CassandraDatastoreProvider.

Indeed, in the method initializeService() from the class 
AbstractServiceRegistryImpl, the phase 4 which is starting the service 
(and so the CassandraDatastoreProvider) is calling twice startService :

// PHASE 4 : Start service
serviceBinding.getLifecycleOwner().startService( serviceBinding );
startService( serviceBinding );

As the start method of CassandraDatastoreProvider is optionaly creating 
the keyspace and initializing the columnFamily, this is done twice and 
is not what is expected.

However, in the version 4.1.1-Final of Hibernate-core, the second call 
is not done.

Is it a real issue and what are the consequences in the ingration of 
other NoSQL products?

Should Hibernate OGM move to Hibernate-core 4.1.1+?
(I already made the work to test but I am not sure of consequence since 
interfaces changed -ex: SessionFactoryImplementor or EntityPersister) 
but it seems to work ;-)



Cheers,

Khanh Tuong
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] [OGM-122/OGM-128] Config key to difference development and production mode

2012-03-25 Thread kmx.pet...@gmail.com
Hi,

I am trying to integrate Cassandra into Hibernate OGM (cf. issue 
OGM-122) and I have some noob questions.

To use Cassandra, it is mandatory to indicate the keyspace to use and to 
switch into the right one.

As the keyspace is determining the application architecture and as it is 
difficult to know how the application has to use the keyspace, we 
decided with Emmanuel that it could be a good solution to distinct the 
development mode where the keyspace & co would be created and the 
production mode where Hibernate OGM would use an already existing keyspace.

We thought that it could be a good idea using the property 
hibernate.hbm2ddl.auto which is well known by hibernate users.
However, setting this property to create or create-drop seems to 
indicate to Hibernate core to create tables with the jdbc dialect.

If I am right, using the value create for the key hibernate.hbm2ddl.auto 
indicates to the class SchemaExport to use JdbcDialect which is not what 
is expected :

this.importFiles = ConfigurationHelper.getString(
 AvailableSettings.HBM2DDL_IMPORT_FILES,
 configuration.getProperties(),
 DEFAULT_IMPORT_FILE
 );

final Dialect dialect = serviceRegistry.getService( JdbcServices.class 
).getDialect();

So, I suggest to use a different key to indicate if the development or 
production mode should be used.

What do you think about?

Cheers,

Khanh Tuong

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev