Home All Groups Group Topic Archive Search About

Manual Transactions and Remoting

Author
26 Jul 2006 6:36 PM
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.

Author
27 Jul 2006 4:39 AM
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

Show quoteHide quote
"Ryan H" <rherr***@smci.com> schreef in bericht
news:O%239P4JOsGHA.5044@TK2MSFTNGP05.phx.gbl...
> 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.
>
>
>
>