Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How I can use different database?

2 views
Skip to first unread message

Frank

unread,
Dec 11, 2005, 8:46:26 AM12/11/05
to
Hi I have an app with a single class for instance Persons and I want to
deploy this app to different back end, (MS Access, sql server, mysql), I
want that the user select which back end he want to use, Which is the
better way to do it using the same .exe?

changing the connection? any Idea please

kind regards
Frank


Jan Nordén [Borland]

unread,
Dec 11, 2005, 10:28:05 AM12/11/05
to
Frank wrote:

The easiest is just to place multiple persistence mappers/connection
pairs on the EcoSpace, and configure each one.

At runtime you just need to set the PersistenceMapper property of the
EcoSpace to the right one prior to activating the EcoSpace.

How do you intend to make the selection, via a register setting?


--
Jan Nordén
Senior Software Architect
MDA products group

Frank

unread,
Dec 11, 2005, 1:19:09 PM12/11/05
to
I think to set using the xml file config.exe file, is correct it?


kind regards

frank
kind regards
"Jan Nordén [Borland]" <jan.n...@borland.com> escribió en el mensaje
news:439c5395$1...@newsgroups.borland.com...

Jan Nordén [Borland]

unread,
Dec 12, 2005, 8:25:51 AM12/12/05
to
Frank wrote:

> I think to set using the xml file config.exe file, is correct it?
>
>

Any way of setting the configuration should work fine. I was just
curious.

Marc Rohloff [TeamB]

unread,
Dec 12, 2005, 7:10:59 PM12/12/05
to
On 11 Dec 2005 08:28:05 -0700, Jan Nordén [Borland] wrote:

> The easiest is just to place multiple persistence mappers/connection
> pairs on the EcoSpace, and configure each one.

Wouldn't it be easier to set up a BDP connection and then just
configure the connection string for the BDP connection?

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com

Jan Nordén [Borland]

unread,
Dec 12, 2005, 10:10:55 PM12/12/05
to
Marc Rohloff [TeamB] wrote:

> On 11 Dec 2005 08:28:05 -0700, Jan Nordén [Borland] wrote:
>
> > The easiest is just to place multiple persistence mappers/connection
> > pairs on the EcoSpace, and configure each one.
>
> Wouldn't it be easier to set up a BDP connection and then just
> configure the connection string for the BDP connection?

No. There are various things in the configuration of the
BdpPersistenceMapper that need to be different for different databases.

Jesper Hogstrom [Borland]

unread,
Dec 13, 2005, 2:46:58 PM12/13/05
to

"Jan Nordén [Borland]" <jan.n...@borland.com> wrote in message
news:439e49cf$1...@newsgroups.borland.com...

> No. There are various things in the configuration of the
> BdpPersistenceMapper that need to be different for different databases.

Most of that configuration sits in PersistenceMapper.SqlDatabaseConfig. It
is possible to set in the same way as using the component editor menu
options by invoking
Borland.Eco.Persistence.Configuration.InitializeDbEngineSettings(DataBaseEngine
engine, SqlDatabaseConfig sqlDatabaseConfig).

--Jesper


Kyle A. Miller

unread,
Apr 19, 2006, 8:46:38 PM4/19/06
to
Jan Nordén [Borland] wrote:
> The easiest is just to place multiple persistence mappers/connection
> pairs on the EcoSpace, and configure each one.
>
> At runtime you just need to set the PersistenceMapper property of the
> EcoSpace to the right one prior to activating the EcoSpace.

I found this to be an interesting thread because I am looking into doing
something similar.

Is it possible to divide up an EcoSpace across more than one database?
For instance, Customer objects would exist in say a Sales database.
Invoice objects would exist on an Accounting database. These databases
may not be on the same machine or be even the same db vendor.

Or will I have to use multiple EcoSpaces? I've never tried that. I guess
I can still query across spaces. Example, show me all Invoices belonging
to an instance of a Customer.

Jonas Hogstrom

unread,
May 5, 2006, 5:11:04 AM5/5/06
to
Kyle A. Miller wrote:

> Jan Nordén [Borland] wrote:
> > The easiest is just to place multiple persistence mappers/connection
> > pairs on the EcoSpace, and configure each one.
> >
> > At runtime you just need to set the PersistenceMapper property of
> > the EcoSpace to the right one prior to activating the EcoSpace.
>
> I found this to be an interesting thread because I am looking into
> doing something similar.
>
> Is it possible to divide up an EcoSpace across more than one
> database? For instance, Customer objects would exist in say a Sales
> database. Invoice objects would exist on an Accounting database.
> These databases may not be on the same machine or be even the same db
> vendor.

That is what the PersistenceMapperMultiDb is for. It is sort of a
dispatcher for databases. It is primarily designed for the case where
you have multiple databases to start with, and want to consolidate them
in one ecospace, and not where you have one model and want to split up
the data into multiple databases (why would you want that anyway?).

There are some issues with creating and evolving databases in a MultiDb
setup.

> Or will I have to use multiple EcoSpaces? I've never tried that. I
> guess I can still query across spaces. Example, show me all Invoices
> belonging to an instance of a Customer.

Well, you can't have cross-ecospace-relations... you would have to rely
on CustomerId or something, and cascading deletes and other nifty stuff
won't work.


--
/Jonas, Borland Eco R&D

0 new messages