ORA-02291

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
darrenzully
Posts: 1
Joined: Mon 03 Nov 2014 13:53

ORA-02291

Post by darrenzully » Mon 03 Nov 2014 13:59

Dear forum,

I'm testing dotConnect for Oracle using the latest trial version, and the following code raise me the ORA-02291 error. Please, can you help me?

Code: Select all

public int Save(ISegmentableConfigurationData configData)
        {
            try
            {
                using (DbContext context = new ConfiguracionContext())
                {
                    var datoDb = context.Set<TConfigurableData>().Find(configData.Id) as TConfigurableData;
                    if (datoDb == null)
                        context.Set<TConfigurableData>().Add(configData as TConfigurableData);
                    else
                        Mapear(datoDb, configData as TConfigurableData, context);

                    context.SaveChanges(); //Here is the problem!!!
                }
            }
            catch (DbEntityValidationException) // TODO: Validación de errores
            {
                configData.Id = 0;
            }
            return configData.Id;
        } 
And the map:

Code: Select all

 public ConfigurationDataTablasMap()
        {
            ToTable("Sx_ConfTab");

            Ignore(x => x.Id);
            Ignore(x => x.Content);

            HasKey(x => x.ConfigurationDataId);

            Property(x => x.ConfigurationDataId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .HasColumnOrder(1);
        }
Thanks,

Darren.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: ORA-02291

Post by MariiaI » Tue 04 Nov 2014 11:12

Please provide us with the following information:
- the Oracle server version;
- the mode you are working with - direct or OCI;
- the full stack trace of the exception;
- the DDL scripts for the necessary database tables (if Code-First functionality is not used for this);
- the generated SQL query: https://www.devart.com/dotconnect/oracl ... nitor.html , etc.

Please create a small test project, with which this error could be reproduced, and send it us, so that we are able to investigate it in more details and find a solution for you.

Post Reply