Session State in Back Office

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
trozzi
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 104
Joined: Wed Oct 05, 2005 4:44 pm
Contact:

Session State in Back Office

Post by trozzi » Thu Aug 14, 2008 10:21 am

We are testing for a client that will be deploying in a web farm. We configured Sql Session State to manage the web site. Everything test fine on the site. We navigated to the following page in he back office

/Admin/Products/Reviews/Default.aspx

We raised the following error

Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.

Thanks
Thomas

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Re: Session State in Back Office

Post by sohaib » Fri Aug 15, 2008 12:46 pm

We configured Sql Session State to manage the web site.
Not sure what this means. Can you please explain?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Session State in Back Office

Post by mazhar » Fri Aug 15, 2008 1:29 pm

Please give a try to this solution. Edit the App_Code/SearchCriteriaCache.cs file
and locate the following class

Code: Select all

 public class SearchCriteria
    {
        public Dictionary<string, object> Arguments;
        public int PageIndex;
        public string SortExpression;
        public SortDirection SortDirection;

        public SearchCriteria()
        {
            Arguments = new Dictionary<string, object>();
            PageIndex = 0;
            SortExpression = string.Empty;
            SortDirection = SortDirection.Ascending;
        }
    }
and mark this class as serializeable by putting an attribute upon it as below

Code: Select all

[Serializable]
 public class SearchCriteria
    {
        public Dictionary<string, object> Arguments;
        public int PageIndex;
        public string SortExpression;
        public SortDirection SortDirection;

        public SearchCriteria()
        {
            Arguments = new Dictionary<string, object>();
            PageIndex = 0;
            SortExpression = string.Empty;
            SortDirection = SortDirection.Ascending;
        }
    }
Last edited by mazhar on Mon Oct 20, 2008 11:06 am, edited 1 time in total.

trozzi
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 104
Joined: Wed Oct 05, 2005 4:44 pm
Contact:

Re: Session State in Back Office

Post by trozzi » Fri Aug 15, 2008 4:22 pm

Thanks AbleCommerce Developers

Thomas

trozzi
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 104
Joined: Wed Oct 05, 2005 4:44 pm
Contact:

Re: Session State in Back Office

Post by trozzi » Tue Aug 19, 2008 11:39 am

Found a new page that has the same error message.

It appears to be from the line of code.
OrderSearchCriteria criteria = Session["OrderSearchCriteria"] as OrderSearchCriteria;

I think this object needs tagged as Serializable, but it is contained in one of Able Commerce's assemblies.

/Admin/Orders/Default.aspx

Thanks
Thomas
Last edited by trozzi on Tue Aug 19, 2008 11:51 am, edited 1 time in total.

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Re: Session State in Back Office

Post by sohaib » Tue Aug 19, 2008 11:50 am

This time the solution is not simple.
The object that needs to be Serializable in this case is in the compiled DLL.
It is CommerceBuilder.Reporting.OrderSearchCriteria.
A DLL update would be needed to get this fixed.
I have escalated this case in our bug tracking system. We will see if a patch could be provided for this.

trozzi
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 104
Joined: Wed Oct 05, 2005 4:44 pm
Contact:

Re: Session State in Back Office

Post by trozzi » Tue Aug 19, 2008 1:09 pm

Another Page

/Admin/Website/Scriptlets/ConLibHelp2.aspx

I greped the admin area for "Session[" and I found these others that look like they may be in the same category...
ConLibHelp.aspx.cs
ConLibHelp2.aspx.cs
ConLibHelpAll.aspx.cs

Thanks
Thomas

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Re: Session State in Back Office

Post by sohaib » Tue Aug 19, 2008 1:14 pm

Yes we have identified the above as well as ConLib/SimilarProducts.ascx.cs as potential candidates for such errors.

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: Session State in Back Office

Post by mfreeze » Thu Jun 11, 2009 10:26 am

I have a client that just upgraded to 7.03 and is still getting this message. According to bug 7075, this should have been fixed in 7.0. I have pasted the exact error we are getting below. The error occurs when attempting to access the Manage/Users screen.
Server Error in '/' Application.
________________________________________
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SerializationException: Type 'CommerceBuilder.Users.UserSearchCriteria' in Assembly 'CommerceBuilder, Version=7.3.12065.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.]
System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) +2700482
System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) +245
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() +88
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +175
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +50
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +438
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +131
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1513

[HttpException (0x80004005): Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.]
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1602
System.Web.SessionState.SessionStateItemCollection.WriteValueToStreamWithAssert(Object value, BinaryWriter writer) +34
System.Web.SessionState.SessionStateItemCollection.Serialize(BinaryWriter writer) +627
System.Web.SessionState.SessionStateUtility.Serialize(SessionStateStoreData item, Stream stream) +257
System.Web.SessionState.SessionStateUtility.SerializeStoreData(SessionStateStoreData item, Int32 initialStreamSize, Byte[]& buf, Int32& length) +60
System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +114
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +476
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: Session State in Back Office

Post by mfreeze » Wed Jun 17, 2009 11:14 am

Can someone at Able take a look at this error, please?
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Session State in Back Office

Post by Logan Rhodehamel » Wed Jun 17, 2009 11:48 am

Bug 8148.. same error message, different code problem.

http://help.ablecommerce.com/upgrades/a ... _7.0.3.htm

It should be corrected by the latest CommerceBuilder.DLL. Please let me know if not.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

Post Reply