Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] HbDataStore - several schemas
[Teneo] HbDataStore - several schemas [message #652865] Mon, 07 February 2011 12:40 Go to next message
Fer Missing name is currently offline Fer Missing nameFriend
Messages: 24
Registered: September 2009
Junior Member
Hi all,

I would like to know if it is possible to use the HbDataStore with different schemas in the same database. I would like to have several schemas (with the same tables) in the same database.

(i.e.:
database A
schema A1
tables: x, y, z
schema A2
tables: x, y, z
schema A3
tables: x, y, z
)

I not be able to create the same tables in different schemas. Crying or Very Sad
Do I need to create a HbDataStore for schema? or I can use the same HbDataSotre with different SessionFactory.

Thanks in advance.

Best Regards,
Fernando
Re: [Teneo] HbDataStore - several schemas [message #652900 is a reply to message #652865] Mon, 07 February 2011 13:22 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Fernando,
Hibernate has an option for directing it to use a certain schema (it is the hibernate.default_schema or the
hibernate.default_catalog property).
As the option is set in the datastore you need to create different datastores for different schemas.

gr. Martiin

On 02/07/2011 01:40 PM, Fer wrote:
> Hi all,
>
> I would like to know if it is possible to use the HbDataStore with different schemas in the same database. I would like
> to have several schemas (with the same tables) in the same database.
>
> (i.e.:
> database A
> schema A1
> tables: x, y, z
> schema A2
> tables: x, y, z
> schema A3
> tables: x, y, z
> )
>
> I not be able to create the same tables in different schemas. :cry: Do I need to create a HbDataStore for schema? or I
> can use the same HbDataSotre with different SessionFactory.
>
> Thanks in advance.
>
> Best Regards,
> Fernando


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] HbDataStore - several schemas [message #652903 is a reply to message #652900] Mon, 07 February 2011 14:26 Go to previous messageGo to next message
Fer Missing name is currently offline Fer Missing nameFriend
Messages: 24
Registered: September 2009
Junior Member
Hi Martin,

Thank you very much.

If I create different datastores for different schemas so I have a memory trouble. Because I need to create all the tables in the new schema again.

Is there any way to avoid having to invoke the datastore.initialize() method for each new datastore ( tables are always the same!)? Because the builSessionFactory() it is very heavy.

Best Regards,
Fernando

[Updated on: Mon, 07 February 2011 14:47]

Report message to a moderator

Re: [Teneo] HbDataStore - several schemas [message #652954 is a reply to message #652903] Mon, 07 February 2011 18:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Fer,
Hmm, you can try the following:
assuming that the tables have all been created in the tables then you can try the following:

((SessionFactoryImpl)dataStore.getSessionFactory()).getSetti ngs().setDefaultSchemaName('newschemaname')

and then call
sessionFactory.openSession()

maybe this will work (I am not sure...)

gr. Martin

On 02/07/2011 03:26 PM, Fer wrote:
> Hi Martin,
>
> Thank you very much.
> If I create different datastores for different schemas so I have a memory trouble.
>
> Is there any way to avoid having to invoke the datastore.initialize() method for each new datastore (the tables all
> always the same!)? Because the builSessionFactory() it is very heavy.
>
> Best Regards,
> Fernando
>
>


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[Teneo] Forcing a Timestamp data type for a column when PersistenceOptions.DEFAULT_TEMPORAL_VALUE, &
Next Topic:[CDO] CDO4 simultaneous release plans
Goto Forum:
  


Current Time: Thu Apr 25 22:36:40 GMT 2024

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

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

Back to the top