Hi,
I am writing a simple application on BOEXI3.1 using visual studio .net 2005. with the below code.
Imports CrystalDecisions.Enterprise
Imports System.Web.Security
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim mySessionMgr As New SessionMgr()
Dim myEnterpriseSession As EnterpriseSession
Dim myInfoStore As InfoStore
Dim myEnterpriseService As EnterpriseService
Try
myEnterpriseSession = mySessionMgr.Logon("administrator", "mypwd", "myserver", "SecEnterprise")
Catch ex As Exception
Throw New Exception("Sorry - You could not be logged on. " & ex.Message)
End Try
myEnterpriseService = myEnterpriseSession.GetService("InfoStore")
myInfoStore = New InfoStore(myEnterpriseService)
Session("InfoStore") = myInfoStore
Session("EnterpriseSession") = myEnterpriseSession
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sInfostoreSQL As String = "select * from ci_infoobjects where si_kind='Webi' and SI_Instance=0"
Dim myInfoStore As InfoStore = CType(Session("InfoStore"), InfoStore)
Dim myInfoObjectsReports As InfoObjects
Try
myInfoObjectsReports = myInfoStore.Query(sInfostoreSQL)
Catch ex As Exception
Throw New Exception("Error in Fetching Report Instances" & ex.Message)
End Try
Dim myinfoobject As InfoObject
For Each myinfoobject In myInfoObjectsReports
Dim str As String
str = myinfoobject.Title
Next
End Sub
End Class
This code run fine first time. Second time when I click on button again I get below error.
I am getting error.
Attempted to read or write protected memory. This is often an
indication that other memory is corrupt
This error seems to be generated by
CrystalDecisions.Enterprise.InfoStore.dll. I tried to view in the
output window and find below is the message into that.
A first chance exception of type 'System.AccessViolationException'
occurred in CrystalDecisions.Enterprise.InfoStore.dll.
I can see some more information in the output window.
3/13/2009 11:38:00 AM {thread-9} ERROR
BusinessObjects.ReportEngine.REException An internal error occured
while calling 'closeDocument' API. (Error: ERR_WIS_30270)
3/13/2009 11:38:00 AM {thread-9} ERROR
BusinessObjects.ReportEngine.WI.Internal.Server.ServerCaller
ParseServerResponse
3/13/2009 11:38:01 AM {thread-9} ERROR
BusinessObjects.ReportEngine.REException An internal error occured
while calling 'closeDocument' API. (Error: ERR_WIS_30270)
3/13/2009 11:38:01 AM {thread-9} ERROR
BusinessObjects.ReportEngine.WI.Internal.Server.ServerCaller
ParseServerResponse
3/13/2009 11:38:01 AM {thread-9} ERROR
BusinessObjects.ReportEngine.REException An internal error occured
while calling 'closeDocument' API. (Error: ERR_WIS_30270)
3/13/2009 11:38:01 AM {thread-9} ERROR
BusinessObjects.ReportEngine.WI.Internal.Server.ServerCaller
ParseServerResponse
3/13/2009 11:38:01 AM {thread-9} ERROR
BusinessObjects.ReportEngine.REException An internal error occured
while calling 'closeDocument' API. (Error: ERR_WIS_30270)
3/13/2009 11:38:01 AM {thread-9} ERROR
BusinessObjects.ReportEngine.WI.Internal.Server.ServerCaller
ParseServerResponse
A first chance exception of type 'System.AccessViolationException'
occurred in CrystalDecisions.Enterprise.InfoStore.dl
Same code is working fine with BOEXIR2. I tried building BOEXI3.1 machine with FP1.3 as well.
Also tested with multple patches of Visual studio. Tried to deploy the code to IIS6.0 still same result.
I am not doing anything complex. It's simple infoobjects retrieval and reuse the session thing.
Any help on this will be appreciated.
Thanks,
Abhay