|
Re: [Teneo] HbDataStore - several schemas [message #652900 is a reply to message #652865] |
Mon, 07 February 2011 08:22   |
Eclipse User |
|
|
|
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 #652954 is a reply to message #652903] |
Mon, 07 February 2011 13:02  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03210 seconds