Sharing ADO.NET Database Connections

PowerBuilder Classic applications can share database ADO.NET connections with third-party .NET assemblies exposed as COM through a connection proxy. The connection proxy is an instance of type IAdoConnectionProxy.

The IAdoConnectionProxy interface is defined in the Sybase.PowerBuilder.DataSource.Sharing.dll assembly as follows:

IAdoConnectionProxy { object Connection; //accepts System.Data.IDbConnection object Transaction; //accepts System.Data.IDbTransaction event EventHandler TransactionChanged; }

Both the PowerBuilder application and the third-party assembly manage connections and transactions by referencing the proxy.

The assembly must be registered as COM by using regasm.exe under the Microsoft.NET\Framework\v4.0 folder. Please refer to the Microsoft MSDN library for information about regasm.exe.

The PowerBuilder Transaction object is the standard PowerBuilder nonvisual object used in database connections. To manage the shared connection, the Transaction object references the AdoConnectionProxy object using these methods: