RE: Share connections between proxies
From: Kevin j Hazlett
Date: 11 Aug 2004
I may be wrong, but the rumor is that Progress will support connection pooling in OE10.0B due out soon. Might want to ask around at Progress a bit.
Kevin Hazlett
Chief Software Architect
DMSi
402.330.6620 ext. 167
ae0b643c-b939-8280-de11-7003b60f74ba
The right tools for building profit.
-----Original Message-----
From: [mailto:] On Behalf Of Jansen Bert
Sent: Wednesday, August 11, 2004 5:21 AM
To:
Subject: RE: Share connections between proxies
I was already taking a look at the generated code and it indeed seems to be fairly easy to build your own .Net generic wrapper : a very simple sample:
using System;
using Progress.Open4GL;
using Progress.Open4GL.Exceptions;
using Progress.Open4GL.Proxy;
using Progress.Open4GL.DynamicAPI;
namespace GenericCallTest
{
/// <summary>
/// Summary description for GenericCall.
/// </summary>
public class GenericCall : AppObject
{
private static int proxyGenVersion = 1;
public GenericCall(string appserverURL)
{
try
{
if (RunTimeProperties.DynamicApiVersion != 4)
throw new Open4GLException(WrongProxyVer, null);
// Last parameter will be used for service name if none is passed in the url.
Connect(appserverURL, "", "", "", "", proxyGenVersion);
}
catch (System.Exception e)
{
throw e;
}
}
public void IssueCall(string callName)
{
if (Session == null)
throw new Open4GLException(NotAvailable, null);
Object outValue;
// Set up input parameters
if (callName == "call1")
{
ParameterSet parms = new ParameterSet(3);
parms.setIntegerParameter(1, 1, ParameterSet.INPUT);
parms.setIntegerParameter(2, 2, ParameterSet.INPUT);
parms.setIntegerParameter(3, 0, ParameterSet.OUTPUT);
Session.runProcedure("call1.p", parms);
outValue = parms.getOutputParameter(3);
}
else
{
ParameterSet parms = new ParameterSet(4);
parms.setDecimalParameter(1, 1, ParameterSet.INPUT);
parms.setDecimalParameter(2, 2, ParameterSet.INPUT);
parms.setDecimalParameter(3, 3, ParameterSet.INPUT);
parms.setDecimalParameter(4, 0, ParameterSet.OUTPUT);
Session.runProcedure("call2.p", parms);
outValue = parms.getOutputParameter(4);
}
}
}
}
Using this technique could solve my problem although I'm afraid that Progress won't support this and that problems can arise when Progress ships new versions of it's .Net assemblies.
Regards,
Bert Jansen
-----Original Message-----
From: Mike Fechner [mailto:ae0b643c-b939-8280-de11-7003493cb7f7]
Sent: woensdag 11 augustus 2004 12:13
To: Jansen Bert
Cc:
Subject: AW: Share connections between proxies
HI Bert,
I'd also try to avoid using the CALL object in the 4GL. If you look at trhe source code of the proxy all proxy calls are kind of dynamic in .NET. Maybe that would be a good starting point also...
In a .NET project I have developed some wrappers for standard business logic objects (most of them ProDataset based). That was a good decision and instead of issueing a dynamic CALL the wrappers receive an input parameter identifying a procedure that will be loaded persistent and execute an internal procedure - passing along the rest of parameters. Kind of the getdata.p used in adm2 working with SDO objetcs.
Regards,
Mike
-----Urspr�ngliche Nachricht-----
Von: Jansen Bert [mailto:ae0b643c-b939-8280-de11-7003e9f953ee]
Gesendet: Mittwoch, 11. August 2004 11:32
An: Mike Fechner
Cc:
Betreff: RE: Share connections between proxies
Hi Mike,
Thanks for the answer. To avoide this problem I was thinking about making one generic proxy which should be independent of the called progress code. This way a proxy regen and deployment aren't an issue anymore. How should one write such a generic proxy. An idea:
First define a generic dataset that holds all your passed parameters (except datasets and temp-tables). Then build a genericinterface.p program that uses the CALL object to issue calls to other.p's. The info for call object (which params which order with which values) is supplied in the generic dataset. After the call is issued the generic dataset is updated with the output variables from the call and is passed to the client. To pass dataset and temp-tables one can define placeholders to support them.
Possible drawbacks:
*) Performance: static call is faster then a dynamic one
*) Can't use typed datasets anymore --> more data passed across the wire which can be troublesome using low bandwidth connections
*) One should implement an object model that eases the process of making a business code call
Advantages:
*) One can easily implement connection pooling
*) No need for proxy regen when code signature changes
*) Business code versioning easily implemented
If such a layer would be generic enough then it could serve all Progress users. What do you think?
Regards,
Bert Jansen
-----Original Message-----
From: Mike Fechner [mailto:ae0b643c-b939-8280-de11-7003493cb7f7]
Sent: woensdag 11 augustus 2004 11:01
To: Jansen Bert
Cc:
Subject: AW: Share connections between proxies
Hi Bert,
AFAIK the only way to share the real AppServer connection is to use Sub-AppObjects. That makes the maintenance a bit easier... The point is that the connection is established in the constructor of the AppObject. Another proxy -> another AppObject -> another connection.
Regards,
Mike
---------------------------------------
fechner & schneider consulting services
Mike Fechner
Breite Str. 116
50667 K�ln
Germany
Tel.: +49 (0) 221 / 27 609-40
Fax.: +49 (0) 221 / 27 609-41
Mobil: +49 (0) 160 / 700 82 29
ae0b643c-b939-8280-de11-7003493cb7f7
http://www.fechnerschneider.de
Consulting, Coaching, Training, Development, Progress, Open Edge, Forte, J2EE, WebServices, Application Integration, Project Management
-----Urspr�ngliche Nachricht-----
Von: [mailto:] Im Auftrag von Jansen Bert
Gesendet: Mittwoch, 11. August 2004 10:23
An:
Betreff: Share connections between proxies
Hello all,
Suppose you have generated multiple .Net assemblies using Progress Openedge proxygen how would you then share connections between them. I want to have a singleton class that implements a pool of connections to the appserver and I want the generated assemblies to use those open connections. As far as I know the connection to the appserver is made when you instantiate the generated class passing the connection info to the constructor.
Eg:
conn = new
Connection("AppserverDC://rls02wp143:31000/realapplied","","", ""); prox = new TestProxy(conn);
I could share the Connection object, but this is just a wrapper around the connection info so that won't work. The thing I want to do is instantiate a second generated class and make it use an open connection.
Is this possible?
Note: the reason why I use multiple proxies is primarely ease of maintenance and deployment. Putting everything in one big proxy just isn't possible.
Environment: Progress 10.0A SP1 on WinXP SP1 using .Net 1.1 with VS 2003.
Best regards,
Bert Jansen