businesslayer.getenumerable(True)


Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Poking around in source code I find the overload for businesslayer.getenumerable



_

Public Function GetEnumerable(ByVal separateInstances As Boolean) As IEnumerable

If separateInstances Then

'-- Create a new business binding source that will be disposed after use

Dim bbs As New BusinessBindingSource(True)

bbs.BusinessObject = Me

Return bbs

Else

Return Me.GetEnumerable()

End If

End Function





This looks cool. I'm trying to come up with a scenario where is can be useful as I am pretty sure there may be a lot of them.



Suggestions?
Dustin Taylor
Dustin Taylor
StrataFrame Team Member (652 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
This has to do with working through a web environment.  The WBBS actually uses a shared data table for parsing.  But the issue on the web is that a root BO is most likely stored in the session.  So you may have two objects referencing the same BO which would cause an issue.  This creates a separate BBS instance so that there is not any cross pollination in a web environment when referencing the same BO through multiple controls using the standard WBBS binding.

I talked to Trent about it to come up to speed (I've never had occasion to use that override myself), and he mentioned that it was recently updated:

 

''' <summary>
        ''' Changed 3/8/2010 for forum post http://forum.strataframe.net/FindPost26315.aspx.  The issue was that a clean up property
        ''' had been added between 1.6 and 1.7 to clean up memory as DevExpress grids (amongst others) would not automatically call the
        ''' Dispose of the enumerator, creating memory leaks.  However, on the web side of things, this caused the shared data table
        ''' to be destroyed before it was ever used.  So the autoDisposeSourceAfterUse param was added so that each environmental
        ''' BBS could set this explicitly.  As of 3/8/2010, the only place that set the second parm as False was the WebBusinessBindingSourceView
        ''' so that DevExpress web grids would work.
        ''' </summary>
        <EditorBrowsable(EditorBrowsableState.Never)> _
        Public Function GetEnumerable(ByVal separateInstances As Boolean, ByVal autoDisposeSourceAfterUse As Boolean) As IEnumerable
            If separateInstances Then
                '-- Create a new business binding source that will be disposed after use
                Dim bbs As New BusinessBindingSource(autoDisposeSourceAfterUse)
                bbs.BusinessObject = Me
                Return bbs
            Else
                Return Me.GetEnumerable()
            End If
        End Function


Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Thanks Dustin



I haven't done any web stuff with SF yet but good to know it will be there when I need it Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search