Re: Sharing a ADO connection between two processes - Can it be done ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On 2 Oct 2006 04:14:29 -0700, "Herby" <prmarjoram@xxxxxxxxx> wrote:

¤ We have a client and server application that run on the same machine.
¤ We want both to participate in the same transaction.
¤
¤ To acheive this I understand they need to share the same connection
¤ object.
¤
¤ The server currently supports a COM interface, as the client passes
¤ across copies of simple data types Strings and integers etc.
¤
¤ But now they want to pass across the client ADO connection object. The
¤ data-writes within the server should then use this connection object
¤ for creating its recordsets etc.
¤
¤ On return to the client - the client may then decide to commit or
¤ rollback via the same connection object.
¤
¤ I understand the server would have a proxy back to the actual
¤ connection object residing in the client address space. Is this going
¤ to work?


No don't do this. ADO Connection objects do not marshal properly across processes.

Your data access layer should be handling the transaction. I don't see any reason for the
transaction to occur across processes. However, it you want the client to determine whether the
transaction is committed or rolled back you may want to consider using COM+.


Paul
~~~~
Microsoft MVP (Visual Basic)
.



Relevant Pages