OCI invalid handle

OCI invalid handle

Postby san_eins » Wed 29 Feb 2012 13:03


We have a windows service which uses DOTCONNECT[6.30] To connect to the oracle database[11g Enterprise Edition Release - 64bit ]. We are using OracleTransaction to read Oracle Queue to dequeue it. Its a repeated call(interval of 5secs) from windows service to Oracle Database.

Please find below code snippet of windows service :

protected override void ProcessMessage(OracleTransaction oracleTransaction)

var memberId = Convert.ToInt32(InputMessage.ObjectPayload["Member_Id"]);
var isBilling = Convert.ToInt32(InputMessage.ObjectPayload["Is_Billing"]) == 1 ? true : false;
// Logic Code Goes Here

catch (Exception ex)
Logger.Error("Error while processing message from the queue.", ex);

We sometimes(not regular) get "OCI invalid handle exception" while oracle queue processing.

The exception Details are as follows :

OutputFileGenerationServiceProcessingUnit::ProcessMessage => Error while processing message from the queue.
Devart.Data.Oracle.OracleException (0x80004005): OCI invalid handle.
at Iata.IS.Business.MiscUatp.Impl.OutputXmlGeneratorManager.GetMiscInvoices(SearchCriteria searchCriteria)
at Iata.IS.Service.OutputFileGenerationService.OutputFileGenerationServiceProcessingUnit.ProcessIdecOrXmlGeneration(BillingPeriod billingPeriod, Member billedMember)
at Iata.IS.Service.OutputFileGenerationService.OutputFileGenerationServiceProcessingUnit.ProcessMessage(OracleTransaction oracleTransaction)

Can you guys see any reasons for this behavior? Please suggest me an alternatives if you have(oracle/devart patch?).

Vinod Patil
Posts: 8
Joined: Wed 29 Feb 2012 11:32

Postby Pinturiccio » Mon 05 Mar 2012 11:46

We could not reproduce the issue.
Could you, please specify the following:
1. Call Stack of the exception;
2. The snippet of the code that is replaced with // Logic Code Goes Here;
Test project for reproducing issue with DDL/DML scripts will be appreciated.
3. In which part of code the issue occurs

Please try to reproduce the issue with the latest version of dotConnect for Oracle and tell us about the result. You can download dotConnect for Oracle Trial Edition here http://www.devart.com/dotconnect/oracle/download.html
Devart Team
Posts: 1860
Joined: Wed 02 Nov 2011 09:44

Re: OCI invalid handle

Postby Jazz77 » Mon 18 Jun 2012 13:41


I have exactly the same problem.
Did someone have any idea what going on ?

Exception 1:
OCI invalid handle.

Exception 2:
Fault on XXXXXXX: Topshelf.Exceptions.TopshelfException
An unhandled exception occurred within the service: XXXXXXXX
Thread was being aborted. at Devart.Data.Oracle.a1.b(Object A_0)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)

Freundliche Grüsse
Posts: 1
Joined: Mon 18 Jun 2012 13:29

Re: OCI invalid handle

Postby Pinturiccio » Tue 19 Jun 2012 12:56

Could you please describe the issue occurrence in details:
1. Does the issue occur not regularly too?
2. Please describe steps for reproducing the issue;
3. Post here a snippet of code where the issue occurs or, if possible, create and send us a small test project for reproducing the issue. If necessary, please send us the corresponding DDL/DML scripts.
Devart Team
Posts: 1860
Joined: Wed 02 Nov 2011 09:44

Return to dotConnect for Oracle