Passing values by reference



I have a class, MyRemoteObject, of which I create a remote instance. I call a sub, CreateAccountAndUser, passing to the sub an Account object and a User Business object, both serializable. The sub takes the info in the busines object and saves the info to the database.

The CreateAccountAndUser sub utilizes two Business objects, Account and User, calling the Save method on each. When the save method is called to create a new account record, the Account.AccountId property is updated with the assigned identify column from the Account table. Same with the User table, the UserId is set after creating a new User record.

I would like to the web app on tier 1 to get the updated versions of the Account and User objects. In the declaration below, the client gets an updated Account object because it is passed as the function's return value. However, the client does not receieve an updated User object even though the User object is passed by reference across the tiers.

Why aren't ByRef params passed across tiers? How do I return this info? Create a parent object that houses the Account and User objects and pass that object back?

Public Class MyRemoteObject

Inherits System.MarshalByRefObject

...

Public Function CreateAccountAndUser(ByVal account As Account, ByRef user As User) As Account

End Class


Relevant Pages

  • Re: buying an acct---Why?
    ... Many people could afford houses but on most servers there was ... Characters were easy to build, ... "stuff" associated w/ the account was not. ... account folks spent a lot of time and effort camping IDOC's... ...
    (alt.games.warcraft)
  • Re: M6 Toll tip.
    ... (Major purchases such as cars and houses aside.) ... If I need a larger amount of cash in a hurry, then I would have a problem without a credit card because it would take around 4 working days to transfer the cash into my current account from one of my savings accounts. ...
    (uk.rec.driving)

Loading