G
Guest
Hi,
VS 2005/.NET 2.0
In my DAL i am running a query and passing the results into a local array.
That array is being passed back to the BAL and through to the Presentaltion
layer.
Now, i would have though that there would be a problem accesssing the array
in the presentation layer, but it appears to work. Is this functionality
guarenteed or not?
My understanding is that when the function is called in the DAL it creates
the array in memory, and passes back a reference to that memory through the
array name. But, at the point where the function call ends, i would expect
that memory to be cleaned up and the reference to the array to no longer be a
valid reference (essentially a dangling pointer). By passing the array
through the layers am i using a non guarented functionality, and it works
only because the garbage collection has not been performed, or is there a
mechanism in .NET that guarentee's the pointer is valid?
VS 2005/.NET 2.0
In my DAL i am running a query and passing the results into a local array.
That array is being passed back to the BAL and through to the Presentaltion
layer.
Now, i would have though that there would be a problem accesssing the array
in the presentation layer, but it appears to work. Is this functionality
guarenteed or not?
My understanding is that when the function is called in the DAL it creates
the array in memory, and passes back a reference to that memory through the
array name. But, at the point where the function call ends, i would expect
that memory to be cleaned up and the reference to the array to no longer be a
valid reference (essentially a dangling pointer). By passing the array
through the layers am i using a non guarented functionality, and it works
only because the garbage collection has not been performed, or is there a
mechanism in .NET that guarentee's the pointer is valid?