System.OverflowException: Value was either too large or too small for an Int32

book

Article ID: 211147

calendar_today

Updated On:

Products

CA Business Service Insight

Issue/Introduction

We are seeing this message on our INT system when we want to view an entry in the Log GUI --> Administration -> Log --> System Log.

"<errors><error><coding_context><file>c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\28ccb947\6e570f86\App_Web_0aopzbxp.2.cs</file><method>ProcessRequest</method><line>0</line></coding_context><info>Exception of type 'System.Web.HttpUnhandledException' was thrown.;Inner exception: System.OverflowException: Value was either too large or too small for an Int32.

   at System.Decimal.FCallToInt32(Decimal d)

   at System.Decimal.System.IConvertible.ToInt32(IFormatProvider provider)

   at System.Convert.ToInt32(Object value)

   at Oblicore.Web.Admin.Logs.SystemLogList.dgData_ItemCommand(Object source, DataGridCommandEventArgs e)

   at System.Web.UI.WebControls.DataGrid.OnItemCommand(DataGridCommandEventArgs e)

   at Oblicore.Web.Controls.Grid.OnItemCommand(DataGridCommandEventArgs e) in D:\Build\Branches\8.3.5-OnGoing\BuildDir\WebFoundations\src\OblicorewebControls\Grid.cs:line 6007

   at System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e)

   at Oblicore.Web.Controls.Grid.OnBubbleEvent(Object source, EventArgs e) in D:\Build\Branches\8.3.5-OnGoing\BuildDir\WebFoundations\src\OblicorewebControls\Grid.cs:line 6491

   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)

   at System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e)

   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)

   at System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e)

   at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)

   at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)

   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)

   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)

   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</info></error></errors>"

Cause

Sequence ID for t_log exceeded the maximum limit of 32 bit integer. The t_logs userid's have reached the maximum limit in terms of the id and hence throwing the above error message.

The maximum for an int is indeed 2,147,483,647.

If you attempt to go past the maximum size, you will receive this error:

Exception of type 'System.Web.HttpUnhandledException' was thrown; Inner exception: System.OverflowException: Value was either too large or too small for an Int32.

Environment

Release : 8.35

Component : CA Business Service Insight

Resolution

Run the below query's on the database and restart LogServer services i.e.

Note: Please run this on a TEST environment before running on a PROD environment and confirm if this suits to your environment.

Steps followed to solve this issue i.e.
----------------------------------------------------------------

select * from t_log order by message_id desc;

truncate table t_log;

drop SEQUENCE  "OBLICORE"."SEQ_SLA_LOG";

CREATE SEQUENCE  "OBLICORE"."SEQ_SLA_LOG" MINVALUE 1000 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 1000 CACHE 25 NOORDER  CYCLE  NOPARTITION;

GRANT SELECT ON "OBLICORE".SEQ_SLA_LOG to oblidbadmin, oblicore;

GRANT ALTER ON "OBLICORE".SEQ_SLA_LOG to oblidbadmin, oblicore;

GRANT select ON oblicore.seq_sla_log to role_usr_reg_privs;

commit;

Additional Information

DE59737 was created for this issue