Manual Transactions and Remoting

R

Ryan H

Hi,

My application is written in VB.NET and has a data access layer that resides
on a different server and is accessed via Remoting.

Currently, when performing an update to the database, I pass the SQL string
and connection string to the data access layer like so:
DataAccessLayerClass.RunSQL("UPDATE MyTable SET Column3 = "aa", "data
source=MyDBServer; initial catalog=...")

However, what I would like to do (but tried and failed) is something like
this (from the client):

Try
DataAccessLayerClass.RunSQL("UPDATE MyTable SET Column3 = "aa", ConnObj,
TransactionObj)
DataAccessLayerClass.RunSQL("UPDATE MyTable2 SET Column3 = "bb", ConnObj,
TransactionObj)
TransactionObj.Commit
Catch
TransactionObj.Rollback
End Try

Any help on how to do this (or an alternative solution) using Remoting would
be appreciated.
 
C

Cor Ligthert [MVP]

Ryan,

The way you want it is in my idea impossible. The object is living at the
client and the only thing you have is the address of it on that in the
managed heap of the client.

An option to try can be to serialize it on the client and to deserialize it
on the server, but by that you are probably sending much more data than you
do now and is the horse behind the car.

Another system can be to create a dictionary with connectionobjects on your
server and play with that.

Just my thoughts,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top