Search found 6 matches

by rstefan
Wed 26 May 2010 08:33
Forum: Entity Framework support
Topic: Problem with SQL WHERE clause generated for boolean
Replies: 1
Views: 1590

Problem with SQL WHERE clause generated for boolean

I have columns in my database as NUMBER(1) which are mapped in my entities to boolean (build with entity developer).
Fine for me.
In database, false values are 0, and true values are different from 0 (often -1).

When I checked the boolean properties of the entities, the property is true if the value in database is different from 0. Fine again.

But when I try to write a Linq expression with a boolean property it fails to return the good result.
For example : a query retrieves all diagnosis that are not obsolete.

Code: Select all

var query = from d in myRepository.Diags where !d.Obsolete;
Here a part of the SQL generated (read from dbMonitor) :

Code: Select all

SELECT ...
FROM DIAGS "Extent1"
	WHERE "Extent1".FOBSOLETE  1
The problem is that where clause can't get the records with true value coded with -1. And it's different for the property value itself.
I use a workaround by testing d.Obsolete != false but it's a bit obvious and the risk of errors in the entire code is major.
by rstefan
Thu 12 Nov 2009 06:35
Forum: Entity Framework support
Topic: Got ORA-22835 exception during SaveChanges
Replies: 3
Views: 4016

AndreyR wrote:This problem is fixed in the upcoming build of dotConnect for Oracle.
Can you tell me when does the next build will be available ?
My company have to package and deliver the application that has this problem to my customers before the 23th november.
Can we expect it before this date ?

Thank you for your previous reactive answer and support.
by rstefan
Fri 06 Nov 2009 14:55
Forum: Entity Framework support
Topic: Got ORA-22835 exception during SaveChanges
Replies: 3
Views: 4016

Got ORA-22835 exception during SaveChanges

I get ORA-22835 exception when I'm trying to store an entity object of my model with a binary field.
If the array of bytes that I set to the binary field is to big, I get this error.
I try differents Max Lengths facets for this field but it doesn't change anything.
Here is the exception :

Code: Select all

[OracleException (0x80004005): ORA-22835: Taille de tampon insuffisante pour la conversion de CLOB en CHAR ou de BLOB en RAW (réelle : 3284, maximum : 2000)]
   Devart.Data.Oracle.an.b(Int32 A_0) +283
   Devart.Data.Oracle.ap.e(Int32 A_0) +47
   Devart.Data.Oracle.ap.a(Int32 A_0, a5 A_1) +1058
   Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords) +4115
   Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior) +749
   System.Data.Common.DbCommand.ExecuteReader() +12
   Devart.Data.Oracle.OracleCommand.ExecuteNonQuery() +64
   Devart.Data.Oracle.Entity.a.m() +104
   System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues) +554
   System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter) +281
Here the SQL request got in DBMonitor :

Code: Select all

 update INFOS
set FNOTE = :p0
where (((FPATID = :p1) and (FITEMKEY = :p2)) and (FINSTANCE = :p3))
the p0 parameter has Blob datatype in DBMonitor and is LONG RAW column in database schema.

How can I store bigger data than 2000 bytes ?
by rstefan
Tue 03 Nov 2009 10:11
Forum: Entity Developer
Topic: The specified metadata path is not valid
Replies: 41
Views: 35591

I answer to myself.
I found the problem.

In fact, my model files were in a subdirectory of the assembly project.
I notice that, in app.config, the connection string contains the metadata resource string. I used it to build my connection string and it works fine.

The model files must be prefixed with the subdirectory name as :

Code: Select all

res://*/Models.MyModel.csdl|res://*/Models.MyModel.ssdl|res://*/Models.MyModel.msl
If this can help someone else who makes the same mistake than me.
by rstefan
Tue 03 Nov 2009 08:27
Forum: Entity Developer
Topic: The specified metadata path is not valid
Replies: 41
Views: 35591

I have similar problem with an ASP.NET MVC project and an assembly containing my model.

In VS2008, everything runs fine, using the integrated webserver.

But after creating a deployement project, generating an msi file, and install it on an test server with IIS 6.0, I get a System.Data.MetadataException when I try the web site.
My entity connection is created like this :

Code: Select all

public static EntityConnection CreateConnection(string server, string user, string password)
        {
string metadata = "metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;provider=Devart.Data.Oracle;provider connection string=\"Server={0};User Id={1};Password={2};Persist Security Info=True\"";
            string connectionString = String.Format(metadata, server, user, password);
            
            return new EntityConnection(connectionString);
        }
and it is used to create the entity container.

I'm using the last version of entity developer (2.20.43) and of dotConnect for Oracle (5.25.49.0)

The setup package that I built must be deployed to customers in first half of november, and I'm running out of ideas to make it works.
by rstefan
Mon 31 Aug 2009 15:19
Forum: Entity Developer
Topic: Bug in protected/Private properties in Complex types
Replies: 5
Views: 3282

private/protected/... is not take in account neither

I get a same problem with classes generated by Entity Developer.


The getter/setter properties are not used to generate code. There are always set to public.

The EDML contains the proper getter/setter but not the generated code.

Do I miss something ?

Here a piece of my EDML file :

Code: Select all

        
          
            
          
          
          
          
          
          
          
          
          
          
          
          
          
          
        
and the generated code for one of the corresponding property :

Code: Select all

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Nullable DayOfMonthImpl
        {
            get
            {
                global::System.Nullable value = this._DayOfMonthImpl;
                OnGetDayOfMonthImpl(ref value);
                return value;
            }
            set
            {
                this.OnDayOfMonthImplChanging(ref value);
                this.ReportPropertyChanging("DayOfMonthImpl");
                this._DayOfMonthImpl = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("DayOfMonthImpl");
                this.OnDayOfMonthImplChanged();
            }
        }
        private global::System.Nullable _DayOfMonthImpl;
        partial void OnGetDayOfMonthImpl(ref global::System.Nullable value);
        partial void OnDayOfMonthImplChanging(ref global::System.Nullable value);
        partial void OnDayOfMonthImplChanged();