ORA-22835 error while using OracleSessionProvider

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
vdobzinski
Posts: 7
Joined: Fri 05 Mar 2010 11:18
Location: Vilnius

ORA-22835 error while using OracleSessionProvider

Post by vdobzinski » Wed 02 Sep 2015 14:23

I'm using OracleSessionProvider (8.4.397.0) version for session info storage in Oracle Database

My configuration:
<system.web>
<compilation>
<assemblies>
<add assembly="Devart.Data.Oracle.Web, Version=8.4.397.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701" />
</assemblies>
</compilation>

<sessionState mode="Custom" timeout="15" regenerateExpiredSessionId="true" customProvider="OracleSessionProvider">
<providers>
<add name="OracleSessionProvider"
type="Devart.Data.Oracle.Web.Providers.OracleSessionStateStore"
connectionStringName="ASP.NET"
enableExpiredSessionAutoDeletion="true" expiredSessionAutoDeletionInterval="1800"
writeExceptionsToEventLog="false"/>
</providers>
</sessionState>

</system.web>


When a large object is placed into Session by Microsoft ReportViewer, I receive an error:
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 10136, maximum: 4000)
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: Devart.Data.Oracle.OracleException: ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 10136, maximum: 4000)

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:

[OracleException (0x80004005): ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 10136, maximum: 4000)]
Devart.Common.Web.Providers.DbSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +1716
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +560
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: ORA-22835 error while using OracleSessionProvider

Post by Pinturiccio » Fri 04 Sep 2015 13:59

Try changing the type of the "details" and "sessionitems" columns of the "aspnet_webevent_events" and "aspnet_sessions" tables respectively from LONG to CLOB. Does it fix the issue?

vdobzinski
Posts: 7
Joined: Fri 05 Mar 2010 11:18
Location: Vilnius

Re: ORA-22835 error while using OracleSessionProvider

Post by vdobzinski » Tue 08 Sep 2015 05:28

Yes, issue was fixed.
But I also had to recreated primary keys because their state has been changed to unusable
Exception type: OracleException
Exception message: ORA-01502: index 'ASP_NET.ASPNET_SESSIONS_SESSIONID_PK' or partition of such index is in unusable state
at Devart.Common.Web.Providers.DbSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)
at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Solution:

Code: Select all

alter table ASPNET_SESSIONS modify sessionitems clob;

alter table ASPNET_SESSIONS
  drop constraint ASPNET_SESSIONS_SESSIONID_PK cascade;

alter table ASPNET_SESSIONS
  add constraint ASPNET_SESSIONS_SESSIONID_PK primary key (SESSIONID, APPLICATIONNAME)
  using index; 

alter table ASPNET_WEBEVENT_EVENTS modify details clob;

alter table ASPNET_WEBEVENT_EVENTS
  drop constraint sys_c0019400 cascade;

alter table ASPNET_WEBEVENT_EVENTS
  add CONSTRAINT ASPNET_WEBEVENT_EVENTS_PK primary key (EVENTID)
  using index;

Post Reply