AW: Db alias and persistent proc issue
From: Kochendoerfer, Michael
Date: 5 May 2008
Did you compile 1.p and 2.p against a database to which you connect using -ld s ??
Michael
-----Urspr�ngliche Nachricht-----
Von: [mailto:]Im Auftrag von Simon
de Kraa
Gesendet: Montag, 5. Mai 2008 11:49
An:
Betreff: Db alias and persistent proc issue
I am having this problem with aliases and persistent procedures.
I looks like I need to restart all persistent procedures for the alias
to be active?
CREATE ALIAS s FOR DATABASE s1.
DEFINE VARIABLE h1 AS HANDLE NO-UNDO.
RUN c:\OpenEdge\WRK\1.p PERSISTENT SET h1.
RUN show IN h1. /* output from database s1 */
CREATE ALIAS s FOR DATABASE s2.
DEFINE VARIABLE h2 AS HANDLE NO-UNDO.
RUN c:\OpenEdge\WRK\2.p PERSISTENT SET h2.
RUN show IN h1. /* output from database s1 !!!!!!!!! */
RUN show IN h2. /* output from database s2 */
/* 1.p & 2.p:
PROCEDURE show:
FIND FIRST customer NO-LOCK.
DISP NAME.
END.
*/
2008/4/29 Stefan Drissen <8b4a52fe-9ac3-7dbb-de11-b20116f96333>:
> Why? Simply compile all code against one database with logical name
> 'workingdb'. Upon compiling the logical database name is locked into the
> r-code. When running the code one of the database must have an alias or
> logical name 'workingdb'.
>
> Regards,
>
> Stefan
>
>
>
>
> -----Original Message-----
> From: [mailto:] On Behalf Of Simon
> de Kraa
> Sent: Tuesday, April 29, 2008 14:36
> To:
> Subject: Re: AppServer licensing question
>
> Thanks Jeff, but then we would need to add the alias workingdb to all
> tables references...
>
> We also thought of adding the database id to primary index of all
> tables but that is a much much more complicated exercise.
>
> Regards,
>
> Simon.
>
> 2008/4/29 <8b4a52fe-9ac3-7dbb-de11-b2019812902f>:
> > Simon de Kraa writes:
> > >We have a number of physical databases mydb1, mydb2, ..., mydbN etc.
> > >that have the same db schema but different data.
> > >At application start up only *one* of these databases is connected
> > >(with -ld mydb).
> > >Different users can connect different databases mydb1, mydb2 etc.
> > >
> > >The stateless appserver must be in sync with the client so the
> > >appserver must connect the same database as the client (for each
> > >appserver call).
> > >The connects will probably (not tested) be a performance killer so we
> > >could also create one appserver broker myasb1, myasb2 etc. per
> > >database mydb1, mydb2 etc.
> > >And have the users always connect to a appserver that is dedicated to
> > >a specific mydb1, mydb2 etc.
> >
> > Rather than a lot of connects, how about starting the appserver
> > connected to all N databases, and use ALIAS to select the working
> > database? Ex:
> > :
> > :
> > run setdb(3).
> > run processcode.
> > :
> > :
> > where setdb is:
> > procedure setdb :
> > define input parameter N as integer no-undo.
> > case N:
> > when 1 then create alias workingdb for database mydb1.
> > when 2 then create alias workingdb for database mydb2.
> > :
> > :
> > when N then create alias workingdb for database mydbN.
> > end case.
> > end.
> >
> > This way you avoid the connect, and can compile against a single
> > database.
> >
> > /jeff
> >
> >
>
>
-------------------------------------------------------------------------
HEM Vertriebs GmbH
Haller Strasse 30
D-74523 Schwaebisch Hall
Fon: +49-791-4079-0
Fax: +49-791-4079-80
http://www.hem.de email: 8b4a52fe-9ac3-7dbb-de11-b2019c9f4a2a
Registergericht: AG Schw�bisch Hall HRB 346
Gesellschafter: Gunter Schaaf, Rene Schaaf, Kurt Schaaf, Friedrich Schaaf
-------------------------------------------------------------------------