This discussion is archived
4 Replies Latest reply: Oct 17, 2012 8:37 AM by 968966 RSS

User Defined Types always throw Exception

955634 Newbie
Currently Being Moderated
Hi,
I have a big issue with UDT trying to call procedures from C#.
When debugging the code all the steps seem to be called properly so I believe that my code isn't too bad. But I still, in the end, get the following :
-----
System.AccessViolationException was unhandled by user code
Message="Tentative de lecture ou d'écriture de mémoire protégée. Cela indique souvent qu'une autre mémoire est endommagée."
Source="Oracle.DataAccess"
StackTrace:
à Oracle.DataAccess.Types.OpsUdt.SetData(IntPtr pOpsConCtx, OpoUdtValCtx* pOpoUdtValCtx)
à Oracle.DataAccess.Types.OracleUdt.SetObjData(OracleConnection conn, IntPtr pUdt, Int32 attrIndex, Object value, Object statusArray)
à Oracle.DataAccess.Types.OracleUdt.SetArrayValue(OracleConnection con, IntPtr pUdt, Int32 attrIndex, Object value, Object statusArray)
à Oracle.DataAccess.Types.OracleUdt.SetValue(OracleConnection con, IntPtr pUdt, Int32 attrIndex, Object value, Object statusArray)
à Oracle.DataAccess.Types.OracleUdt.SetValue(OracleConnection con, IntPtr pUdt, String attrName, Object value, Object statusArray)
à Oracle.DataAccess.Types.OracleUdt.SetValue(OracleConnection con, IntPtr pUdt, String attrName, Object value)
à SCAS.DATA.ListServicesVerses.FromCustomObject(OracleConnection con, IntPtr pUdt) dans D:\***\***.cs:ligne 549
à Oracle.DataAccess.Client.OracleParameter.SetUDTFromCustomObject(OracleConnection conn, IOracleCustomType customObj, Int32 i)
à Oracle.DataAccess.Client.OracleParameter.PreBind_Collection(OracleConnection conn)
à Oracle.DataAccess.Client.OracleParameter.PreBind(OracleConnection conn, IntPtr errCtx, Int32 arraySize)
à Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
InnerException:
-----

Background info :
- Visual Studio 2008
- C# .Net 3.5
- Oracle Client 11.1.0.7.0
- ODAC 11.1.0.7.20

The procedure has 14 base type IN parameters, 2 custom tables IN parameters and 1 OUT parameter
The custom tables are the same and are tables of a custom type
The custom type has 17 base type values and 2 different custom tables of custom types

See following code :
-----
CREATE OR REPLACE TYPE ElementPaiement AS OBJECT (
ID_Paiement NUMBER(10,0),
MontantRecetteRegularise NUMBER(10,0),
MontantPaiementRecette NUMBER(10,0),
MoyenPaiement NUMBER(5,0),
QteSupport NUMBER(5,0)
);
CREATE TYPE ListElementPaiement IS TABLE OF ElementPaiement;

CREATE OR REPLACE TYPE FacturationFirme AS OBJECT (
MontantFactFirme NUMBER(10,0),
Id_Firme NUMBER(10,0),
OrderId VARCHAR2(80)
);
CREATE OR REPLACE TYPE ListFacturationsParFirme IS TABLE OF FacturationFirme;

CREATE OR REPLACE TYPE ServiceARegulariser AS OBJECT (
ID NUMBER(15,0),
Etat NUMBER,
MontantAnnule NUMBER(10,0),
MontantRemboursement NUMBER(10,0),
MontantVerse NUMBER(10,0),
DateOuverture DATE,
DateFermeture DATE,
NumService VARCHAR2(32),
idExplVente NUMBER(3,0),
typeEqp VARCHAR2(8),
CEB VARCHAR2(76),
Comments VARCHAR2(4000),
RecetteAnnule NUMBER(10,0),
RecetteRemboursement NUMBER(10,0),
RecetteNetteAVerser NUMBER(10,0),
NumCompagnie NUMBER(5,0),
NumReseau NUMBER(3,0),
ListFactFirme ListFacturationsParFirme,
ListElemPaiement ListElementPaiement
);
CREATE OR REPLACE TYPE ListServicesVerses IS TABLE OF ServiceARegulariser;

PROCEDURE accepterVersCaissierExploit (p_IdSession IN VERS_VERSEMENTS.id_session_versement%TYPE,
                         p_TypeVersement IN VERS_VERSEMENTS.TYPE_VERSEMENT%TYPE,
                         p_MntAVers IN VERS_VERSEMENTS.MNT_NET_DU%TYPE,
                         p_MntVers IN VERS_VERSEMENTS.MNT_VERSEMENT%TYPE,
                         p_EcartVers IN VERS_VERSEMENTS.ECART_VERSEMENT%TYPE,
                         p_NumExplAgent IN VERS_VERSEMENTS.NUM_EXPL_AGENT%TYPE,
                         p_NumMatriculeAgent IN VERS_VERSEMENTS.NUM_MATRICULE_AGENT%TYPE,
                         p_IdCaisse IN VERS_VERSEMENTS.ID_CAISSE%TYPE,
                         p_EtatRegulSvc IN VERS_VERSEMENT_SRV_AGENT.STATUT_VERSEMENT%TYPE,
                         p_TypeReceptionParActivite IN VERS_DTL_ACCOUNT.TYPE_VERSEMENT%TYPE,
                         p_TypeRegularisationAct IN VERS_DTL_VERSEMENT.TYPE_VERSEMENT%TYPE,
                         p_TypeRegularisationLibre IN VERS_DTL_VERSEMENT.TYPE_VERSEMENT%TYPE,
                         p_IdUser IN VERS_AUDIT_DTL.ID_USER%TYPE,
                         p_TypeReceptionParSaisieLibre IN VERS_DTL_ACCOUNT.TYPE_VERSEMENT%TYPE,
                         p_ListeDesServicesVerses IN ListServicesVerses,
                         p_listeDesServicesLibreVerses IN ListServicesVerses,
                         v_IdVersement OUT NUMBER);
-----

So before posting more details and code, is it possible to use such complexity with ODP.Net?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points