Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » teneo - two different hibernate databases in one ResourceSet
teneo - two different hibernate databases in one ResourceSet [message #62757] Sun, 26 November 2006 19:21 Go to next message
Andre Pareis is currently offline Andre PareisFriend
Messages: 113
Registered: July 2009
Senior Member
Hi (Martin),

I would like to create a ResourceSet in my editor having two connections to two
different datasources. Basically I have two databases, one for static low volume
and another one for dynamic, high volume data. The objects in the static
resource should do queries in the other resource and create temporary
associations (transient).

As far as I understand, it should be easy to use two different datasources using
a dsName=... in the resource URL, but I wonder how do I tell teneo or the
hibernate layer which connection URLs to use in each of the different
datasources? How is such a scenario initialized? Any quick suggestions?

Regards
Andre
Re: teneo - two different hibernate databases in one ResourceSet [message #62779 is a reply to message #62757] Sun, 26 November 2006 22:17 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Andre,
To accomplish this you can initialize two different HbDataStores and use their names in the uri (as
value of the dsname parameter).

gr. Martin

Andre Pareis wrote:
> Hi (Martin),
>
> I would like to create a ResourceSet in my editor having two connections
> to two different datasources. Basically I have two databases, one for
> static low volume and another one for dynamic, high volume data. The
> objects in the static resource should do queries in the other resource
> and create temporary associations (transient).
>
> As far as I understand, it should be easy to use two different
> datasources using a dsName=... in the resource URL, but I wonder how do
> I tell teneo or the hibernate layer which connection URLs to use in each
> of the different datasources? How is such a scenario initialized? Any
> quick suggestions?
>
> Regards
> Andre


--

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: teneo - two different hibernate databases in one ResourceSet [message #62812 is a reply to message #62779] Mon, 27 November 2006 01:13 Go to previous messageGo to next message
Andre Pareis is currently offline Andre PareisFriend
Messages: 113
Registered: July 2009
Senior Member
Hi Martin,

that's the part which is more or less clear to me.

However, the HbDataStore initializes its hibernate session factory using a
hibernate.properties file found in the classpath. There can be only one
hibernate.properties, and it does also tell the SF exactly one URL for
connecting to a DB, but I need two different URLs.

I know that there is the option to intercept the creation of HbDataStoreS using
a factory, but what to set there? Is the hibernate.properties loaded by
hibernate or by teneo? How can I pass in a different JDBC URL for each HbDataStore?

Thanks
Andre




Martin Taal wrote:
> Hi Andre,
> To accomplish this you can initialize two different HbDataStores and use
> their names in the uri (as value of the dsname parameter).
>
> gr. Martin
>
> Andre Pareis wrote:
>> Hi (Martin),
>>
>> I would like to create a ResourceSet in my editor having two
>> connections to two different datasources. Basically I have two
>> databases, one for static low volume and another one for dynamic, high
>> volume data. The objects in the static resource should do queries in
>> the other resource and create temporary associations (transient).
>>
>> As far as I understand, it should be easy to use two different
>> datasources using a dsName=... in the resource URL, but I wonder how
>> do I tell teneo or the hibernate layer which connection URLs to use in
>> each of the different datasources? How is such a scenario initialized?
>> Any quick suggestions?
>>
>> Regards
>> Andre
>
>
Re: teneo - two different hibernate databases in one ResourceSet [message #62828 is a reply to message #62812] Mon, 27 November 2006 04:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Andre,
The hibernate.properties file is read by Hibernate. For your case the easiest would be to set the
properties directly in the hbDataStore by calling setHibernateProperties(Properties hibernateProperties)
(and remove the hibernate.properties file in the root of the classpath).

then you can decide yourselve where to read the (jdbc) properties from and have different properties
for different datastores.

gr. Martin

Andre Pareis wrote:
> Hi Martin,
>
> that's the part which is more or less clear to me.
>
> However, the HbDataStore initializes its hibernate session factory using
> a hibernate.properties file found in the classpath. There can be only
> one hibernate.properties, and it does also tell the SF exactly one URL
> for connecting to a DB, but I need two different URLs.
>
> I know that there is the option to intercept the creation of
> HbDataStoreS using a factory, but what to set there? Is the
> hibernate.properties loaded by hibernate or by teneo? How can I pass in
> a different JDBC URL for each HbDataStore?
>
> Thanks
> Andre
>
>
>
>
> Martin Taal wrote:
>> Hi Andre,
>> To accomplish this you can initialize two different HbDataStores and
>> use their names in the uri (as value of the dsname parameter).
>>
>> gr. Martin
>>
>> Andre Pareis wrote:
>>> Hi (Martin),
>>>
>>> I would like to create a ResourceSet in my editor having two
>>> connections to two different datasources. Basically I have two
>>> databases, one for static low volume and another one for dynamic,
>>> high volume data. The objects in the static resource should do
>>> queries in the other resource and create temporary associations
>>> (transient).
>>>
>>> As far as I understand, it should be easy to use two different
>>> datasources using a dsName=... in the resource URL, but I wonder how
>>> do I tell teneo or the hibernate layer which connection URLs to use
>>> in each of the different datasources? How is such a scenario
>>> initialized? Any quick suggestions?
>>>
>>> Regards
>>> Andre
>>
>>


--

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: teneo - two different hibernate databases in one ResourceSet [message #62884 is a reply to message #62828] Tue, 28 November 2006 19:22 Go to previous message
Andre Pareis is currently offline Andre PareisFriend
Messages: 113
Registered: July 2009
Senior Member
Hi Martin,

cool, that sounds doable ;)

Thanks,
Andre


Martin Taal wrote:
> Hi Andre,
> The hibernate.properties file is read by Hibernate. For your case the
> easiest would be to set the properties directly in the hbDataStore by
> calling setHibernateProperties(Properties hibernateProperties)
> (and remove the hibernate.properties file in the root of the classpath).
>
> then you can decide yourselve where to read the (jdbc) properties from
> and have different properties for different datastores.
>
> gr. Martin
>
> Andre Pareis wrote:
>> Hi Martin,
>>
>> that's the part which is more or less clear to me.
>>
>> However, the HbDataStore initializes its hibernate session factory
>> using a hibernate.properties file found in the classpath. There can be
>> only one hibernate.properties, and it does also tell the SF exactly
>> one URL for connecting to a DB, but I need two different URLs.
>>
>> I know that there is the option to intercept the creation of
>> HbDataStoreS using a factory, but what to set there? Is the
>> hibernate.properties loaded by hibernate or by teneo? How can I pass
>> in a different JDBC URL for each HbDataStore?
>>
>> Thanks
>> Andre
>>
>>
>>
>>
>> Martin Taal wrote:
>>> Hi Andre,
>>> To accomplish this you can initialize two different HbDataStores and
>>> use their names in the uri (as value of the dsname parameter).
>>>
>>> gr. Martin
>>>
>>> Andre Pareis wrote:
>>>> Hi (Martin),
>>>>
>>>> I would like to create a ResourceSet in my editor having two
>>>> connections to two different datasources. Basically I have two
>>>> databases, one for static low volume and another one for dynamic,
>>>> high volume data. The objects in the static resource should do
>>>> queries in the other resource and create temporary associations
>>>> (transient).
>>>>
>>>> As far as I understand, it should be easy to use two different
>>>> datasources using a dsName=... in the resource URL, but I wonder how
>>>> do I tell teneo or the hibernate layer which connection URLs to use
>>>> in each of the different datasources? How is such a scenario
>>>> initialized? Any quick suggestions?
>>>>
>>>> Regards
>>>> Andre
>>>
>>>
>
>
Re: teneo - two different hibernate databases in one ResourceSet [message #596173 is a reply to message #62757] Sun, 26 November 2006 22:17 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Andre,
To accomplish this you can initialize two different HbDataStores and use their names in the uri (as
value of the dsname parameter).

gr. Martin

Andre Pareis wrote:
> Hi (Martin),
>
> I would like to create a ResourceSet in my editor having two connections
> to two different datasources. Basically I have two databases, one for
> static low volume and another one for dynamic, high volume data. The
> objects in the static resource should do queries in the other resource
> and create temporary associations (transient).
>
> As far as I understand, it should be easy to use two different
> datasources using a dsName=... in the resource URL, but I wonder how do
> I tell teneo or the hibernate layer which connection URLs to use in each
> of the different datasources? How is such a scenario initialized? Any
> quick suggestions?
>
> Regards
> Andre


--

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: teneo - two different hibernate databases in one ResourceSet [message #596198 is a reply to message #62779] Mon, 27 November 2006 01:13 Go to previous message
Andre Pareis is currently offline Andre PareisFriend
Messages: 113
Registered: July 2009
Senior Member
Hi Martin,

that's the part which is more or less clear to me.

However, the HbDataStore initializes its hibernate session factory using a
hibernate.properties file found in the classpath. There can be only one
hibernate.properties, and it does also tell the SF exactly one URL for
connecting to a DB, but I need two different URLs.

I know that there is the option to intercept the creation of HbDataStoreS using
a factory, but what to set there? Is the hibernate.properties loaded by
hibernate or by teneo? How can I pass in a different JDBC URL for each HbDataStore?

Thanks
Andre




Martin Taal wrote:
> Hi Andre,
> To accomplish this you can initialize two different HbDataStores and use
> their names in the uri (as value of the dsname parameter).
>
> gr. Martin
>
> Andre Pareis wrote:
>> Hi (Martin),
>>
>> I would like to create a ResourceSet in my editor having two
>> connections to two different datasources. Basically I have two
>> databases, one for static low volume and another one for dynamic, high
>> volume data. The objects in the static resource should do queries in
>> the other resource and create temporary associations (transient).
>>
>> As far as I understand, it should be easy to use two different
>> datasources using a dsName=... in the resource URL, but I wonder how
>> do I tell teneo or the hibernate layer which connection URLs to use in
>> each of the different datasources? How is such a scenario initialized?
>> Any quick suggestions?
>>
>> Regards
>> Andre
>
>
Re: teneo - two different hibernate databases in one ResourceSet [message #596203 is a reply to message #62812] Mon, 27 November 2006 04:32 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Andre,
The hibernate.properties file is read by Hibernate. For your case the easiest would be to set the
properties directly in the hbDataStore by calling setHibernateProperties(Properties hibernateProperties)
(and remove the hibernate.properties file in the root of the classpath).

then you can decide yourselve where to read the (jdbc) properties from and have different properties
for different datastores.

gr. Martin

Andre Pareis wrote:
> Hi Martin,
>
> that's the part which is more or less clear to me.
>
> However, the HbDataStore initializes its hibernate session factory using
> a hibernate.properties file found in the classpath. There can be only
> one hibernate.properties, and it does also tell the SF exactly one URL
> for connecting to a DB, but I need two different URLs.
>
> I know that there is the option to intercept the creation of
> HbDataStoreS using a factory, but what to set there? Is the
> hibernate.properties loaded by hibernate or by teneo? How can I pass in
> a different JDBC URL for each HbDataStore?
>
> Thanks
> Andre
>
>
>
>
> Martin Taal wrote:
>> Hi Andre,
>> To accomplish this you can initialize two different HbDataStores and
>> use their names in the uri (as value of the dsname parameter).
>>
>> gr. Martin
>>
>> Andre Pareis wrote:
>>> Hi (Martin),
>>>
>>> I would like to create a ResourceSet in my editor having two
>>> connections to two different datasources. Basically I have two
>>> databases, one for static low volume and another one for dynamic,
>>> high volume data. The objects in the static resource should do
>>> queries in the other resource and create temporary associations
>>> (transient).
>>>
>>> As far as I understand, it should be easy to use two different
>>> datasources using a dsName=... in the resource URL, but I wonder how
>>> do I tell teneo or the hibernate layer which connection URLs to use
>>> in each of the different datasources? How is such a scenario
>>> initialized? Any quick suggestions?
>>>
>>> Regards
>>> Andre
>>
>>


--

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: teneo - two different hibernate databases in one ResourceSet [message #596271 is a reply to message #62828] Tue, 28 November 2006 19:22 Go to previous message
Andre Pareis is currently offline Andre PareisFriend
Messages: 113
Registered: July 2009
Senior Member
Hi Martin,

cool, that sounds doable ;)

Thanks,
Andre


Martin Taal wrote:
> Hi Andre,
> The hibernate.properties file is read by Hibernate. For your case the
> easiest would be to set the properties directly in the hbDataStore by
> calling setHibernateProperties(Properties hibernateProperties)
> (and remove the hibernate.properties file in the root of the classpath).
>
> then you can decide yourselve where to read the (jdbc) properties from
> and have different properties for different datastores.
>
> gr. Martin
>
> Andre Pareis wrote:
>> Hi Martin,
>>
>> that's the part which is more or less clear to me.
>>
>> However, the HbDataStore initializes its hibernate session factory
>> using a hibernate.properties file found in the classpath. There can be
>> only one hibernate.properties, and it does also tell the SF exactly
>> one URL for connecting to a DB, but I need two different URLs.
>>
>> I know that there is the option to intercept the creation of
>> HbDataStoreS using a factory, but what to set there? Is the
>> hibernate.properties loaded by hibernate or by teneo? How can I pass
>> in a different JDBC URL for each HbDataStore?
>>
>> Thanks
>> Andre
>>
>>
>>
>>
>> Martin Taal wrote:
>>> Hi Andre,
>>> To accomplish this you can initialize two different HbDataStores and
>>> use their names in the uri (as value of the dsname parameter).
>>>
>>> gr. Martin
>>>
>>> Andre Pareis wrote:
>>>> Hi (Martin),
>>>>
>>>> I would like to create a ResourceSet in my editor having two
>>>> connections to two different datasources. Basically I have two
>>>> databases, one for static low volume and another one for dynamic,
>>>> high volume data. The objects in the static resource should do
>>>> queries in the other resource and create temporary associations
>>>> (transient).
>>>>
>>>> As far as I understand, it should be easy to use two different
>>>> datasources using a dsName=... in the resource URL, but I wonder how
>>>> do I tell teneo or the hibernate layer which connection URLs to use
>>>> in each of the different datasources? How is such a scenario
>>>> initialized? Any quick suggestions?
>>>>
>>>> Regards
>>>> Andre
>>>
>>>
>
>
Previous Topic:Can Validation handle inter-model constraints?
Next Topic:Does Teneo deal with interfaces correctly?
Goto Forum:
  


Current Time: Sat Feb 27 22:21:49 GMT 2021

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

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

Back to the top