Search found 54 matches

by JoeRuspante
Tue 03 Dec 2013 22:36
Forum: dotConnect for MySQL
Topic: outer apply
Replies: 1
Views: 1161

outer apply

Hi everybody.
I see that DotConnect for Oracle supports Outer Apply in EF6 with Oracle 12c.

Is the same problem solved also on DotConnect for MySql
by JoeRuspante
Mon 16 Sep 2013 10:02
Forum: dotConnect for Oracle
Topic: Slow insert
Replies: 1
Views: 1112

Slow insert

Hi everybody.

I have a simple model Class:

Code: Select all



    [Table("USER_TEST")]
    public class User
    {

        public long Id { get; set; }

        public string Name { get; set; }

    }

Then I have my DbContext with this settings:

Code: Select all


public class MyContext : DbContext
{

    public MyContext()
        : base("MyConnectionString")
    {
        InitializeOracle();
    }

    private void InitializeOracle()
    {
        OracleEntityProviderConfig.Instance.CodeFirstOptions.UseNonUnicodeStrings = true;
        OracleEntityProviderConfig.Instance.QueryOptions.CaseInsensitiveLike = true;
        OracleEntityProviderConfig.Instance.Workarounds.IgnoreSchemaName = true;
        OracleEntityProviderConfig.Instance.Workarounds.IgnoreDboSchemaName = true;
        OracleEntityProviderConfig.Instance.CodeFirstOptions.TruncateLongDefaultNames = false;
        OracleEntityProviderConfig.Instance.CodeFirstOptions.UseDateTimeAsDate = true;
        OracleEntityProviderConfig.Instance.Workarounds.DisableQuoting = true;
        OracleEntityProviderConfig.Instance.Workarounds.ColumnTypeCasingConventionCompatibility = true;
        }

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        Database.SetInitializer<MyContext>(null);
        modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        modelBuilder.Conventions.Remove<ColumnTypeCasingConvention>();
        modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
        base.OnModelCreating(modelBuilder);
    }

    public DbSet<User> Users { get; set; }

}



Now I try to add 1.000 users to the db:

Code: Select all


MyContext ctx = null;
try
{
   ctx = new MyContext();
   ctx.Configuration.ValidateOnSaveEnabled = false;
   for (int i = 0; i < 1000; i++)
   {
      User u = new User();
      u.Name = "User" + i.ToString();
      ctx.Users.Add(u);
   }
   ctx.SaveChanges();
}
finally
{
   if (ctx != null)
   {
      ctx.Dispose();
      GC.SuppressFinalize(ctx);
   }
}


I don't know why, but that code requires about 18 seconds to run. How can I make it faster?
If I do it by hand (OracleConnection + OracleCommand) it takes about 2.5 seconds...


I'm using:
- .Net framework 4.5
- Devart 7.4.146
by JoeRuspante
Fri 24 May 2013 10:41
Forum: dotConnect for Oracle
Topic: EF6 - OpenSource - OuterApply
Replies: 1
Views: 1884

EF6 - OpenSource - OuterApply

Hi everybody.

I saw that EntityFramework is now Open Source, so anybody could help to resolve the "OuterApply not supported by Oracle" problem.

Do you plan to help Microsoft to solve this issue? (maybe better say "convince Microsoft to do it")

I also saw that now EF6 (beta) has a kind of Interceptor... Maybe you could implement that interceptor for convert the "OuterApply" to another query that the DB could execute.

This is the link: https://entityframework.codeplex.com/wi ... terception

I know that the best way will be done by Microsoft using standard SQL, but since Microsoft sells SQL, maybe isn't interessed in that problem.
So, if you can do it throw any kind of way (for example with Interceptor), why can't you try to do it?

Thank you in advance.
by JoeRuspante
Tue 23 Apr 2013 14:54
Forum: dotConnect for Oracle
Topic: NuGet
Replies: 5
Views: 1654

Re: NuGet

Thank you, but we need some functionalities that express does not support (EF and Direct mode).

So we think to create a custom NuGet server (internal to our site), so we can use it for all projects. The problem that we have is the licence.

Now we can use DotConnect without have installed it, need only a "licx" file + additional file generated by the "lc" command (we read it on the licencing tutorial of devart).

The problem is that we use it in more project. There is a way to create a "licx" file (and additional license file) that doesn't need the name of the assembly? So we can generate a NuGet package that contains DLL and licence files without create a package for each solution.


Thank you in advance
by JoeRuspante
Thu 18 Apr 2013 15:40
Forum: dotConnect for Oracle
Topic: NuGet
Replies: 5
Views: 1654

Re: NuGet

We did the backend without using designers or Visual Studio integrations.
We only need the runtime dll (included in the project, nothing more).

What do you suggest? Can we use the "Express" version for have the NuGet functionality? Or bux-fixes will arrive later on this version?

Of course, we will continue to buy licences for the support, but have a NuGet server will help us a lot.

Thank you in advance
by JoeRuspante
Fri 28 Dec 2012 17:39
Forum: dotConnect for Oracle
Topic: ORA-8177
Replies: 1
Views: 1073

ORA-8177

Hi everybody.

I'm using dotConnect for Oracle 7.4.142 and EntityFramework Code First (Runtime 4.5).
In a solution I'm reading xml files from a directory and update an Oracle's table.

This is a simply code:

Code: Select all


MyDbContext ctx = new MyDbContext();
foreach (var item in Directory.GetFiles(@"mydir", "*.xml")
{

   Customer c = new Customer();
   // Loading data into c variable from xml file
   ctx.Customers.Add(c);
   using (TransactionScope t = new TransactionScope())
   {
      ctx.SaveChanges();
      t.Complete();
   }

}


When I have a lot of files to elaborate in a same execution, the programm exit with "ORA-8177" error.

It seems a problem of the IsolationLevel used.

How can I change it?

PS: On MyDbContext I make some configurations by code...

Code: Select all



OracleEntityProviderConfig.Instance.CodeFirstOptions.UseNonUnicodeStrings = true;
OracleEntityProviderConfig.Instance.Workarounds.IgnoreSchemaName = true;
OracleEntityProviderConfig.Instance.Workarounds.IgnoreDboSchemaName = true;
OracleEntityProviderConfig.Instance.CodeFirstOptions.TruncateLongDefaultNames = true;
OracleEntityProviderConfig.Instance.CodeFirstOptions.UseDateTimeAsDate = true;
OracleEntityProviderConfig.Instance.Workarounds.DisableQuoting = true;
OracleEntityProviderConfig.Instance.Workarounds.ColumnTypeCasingConventionCompatibility = true;
by JoeRuspante
Wed 21 Nov 2012 23:53
Forum: dotConnect for Oracle
Topic: Strange Include query
Replies: 4
Views: 1075

Re: Strange Include query

If I understood, EF passes an Expression Tree.

So it has to tell to the provider that the query needs 2 fields from the table.
But, who write the query?

Because the generated query is something like that:

Code: Select all


SELECT Extent1.Name,
       Extent2.Surname
FROM Customer C
     JOIN CustomerDetails Extent1 ON ( C.CustomerDetailsId = Extent1.Id)
     JOIN CustomerDetails Extent2 ON ( C.CustomerDetailsId = Extent1.Id)
So, is EF4.5 that generate the query with this unnecessary joins? Or does your provider receive a tree and converts it in this query?


It's only for understand. I thought your driver writes the query and not EF4.5 (wrote by Microsoft and that won't work with Oracle)
by JoeRuspante
Wed 21 Nov 2012 09:02
Forum: LINQ Insight
Topic: Is it possible to use it with code first + dotConnect for Oracle
Replies: 1
Views: 2213

Is it possible to use it with code first + dotConnect for Oracle

I'm interested in the Linq Insight tool.

Is it possible to use it with code first + dotConnect for Oracle?

If so, does it support the fact that in my solution I have a project with only the data model (class object) and another one with only the DbContext (so DbContext and class definitions are in two differents assembly/projects).


Thank you in advance
by JoeRuspante
Mon 19 Nov 2012 12:27
Forum: dotConnect for Oracle
Topic: OUTER APPLY WORKAROUND
Replies: 1
Views: 1002

OUTER APPLY WORKAROUND

There is a workaround for use a LINQ that throws teh "OUTER APPLY NOT SUPPORTER BY ORACLE" exception?


I saw the workaround when I need only a field (ex: min(date)).
In my case I have an order with more details (1 to N relationship) and I need to have all the data of the first detail row (quantity, price, ...)

My LINQ query is this:

Code: Select all


var query = from o in MyContext.Orders
            let d = o.Details.OrderBy(x => x.Id).FirstOrDefault()
            select new OrderDTO
            {
                Id = o.Id,
                ProductId = d.ProductId,
                Price = d.Price
                Quantity = d.Quantity
            }


Thank you in advance
by JoeRuspante
Mon 19 Nov 2012 09:52
Forum: dotConnect for Oracle
Topic: Strange Include query
Replies: 4
Views: 1075

Re: Strange Include query

For now I founded a workaround using the "let" clause.
But I think it's not common use the "let" for all descendants relationship.

I hope you will give me a solution as soon as possible
by JoeRuspante
Fri 16 Nov 2012 12:26
Forum: dotConnect for Oracle
Topic: Strange Include query
Replies: 4
Views: 1075

Strange Include query

Hi everybody.

I'm working with the latest version of DotConnect for Oralce and I have this model:

Code: Select all


public class Order
{
    public int Id {get;set;}
    public int Number {get;set;}
    // Other properties

    // Relationship with Customer
    public int CustomerId {get;set;}
    public Customer Customer {get;set;}
}

public class Customer
{

    public int Id {get;set;}
    // Other properties

    // Relationship with CustomerDetails
    public CustomerDetails Details {get;set;}
}


public class CustomerDetails
{

    public int Id {get;set;}
    public string Name {get;set;}
    public string Surname {get;set;}
}


Now I have a method that need a single object CustomerDTO done in this way:

Code: Select all



public class CustomerDTO
{
    // From Customer
    public int Id {get;set;}

    // From CustomerDetails
    public string Name {get;set;}
    public string Surname {get;set;}
} 



Now I extract all orders with this query linq:

Code: Select all


var query = MyDbContext.Orders
                .Include(x => x.Customer)
                .Include(x => x.Customer.Details)
                .Select(x => new OrderDTO
                      {
                         // Order properties
                         Customer = new CustomerDTO
                         {
                             Id = x.Customer.Id,
                             Name = x.Customer.Details.Name,
                             Surname = x.Customer.Details.Surname
                         }
                      }
                );


Looking with DbMonitor the query, I saw that the join between Customer and CustomerDetails occurs two times (one for each field taken from x.Customer.Details object).
If I took only the Name, the join appears only 1 time.
If I took Name, Surname and Address, it occurs 3 times.


Why?
by JoeRuspante
Thu 04 Oct 2012 09:17
Forum: dotConnect for Oracle
Topic: DateTime mapping CodeFirst
Replies: 4
Views: 2134

Re: DateTime mapping CodeFirst

Thank you very much
by JoeRuspante
Wed 12 Sep 2012 09:29
Forum: dotConnect for Oracle
Topic: DateTime mapping CodeFirst
Replies: 4
Views: 2134

DateTime mapping CodeFirst

Hi everybody.

I have a problem with DateTime properties (.NET DateTime).
Using dotConnect for Oracle, it maps DateTime property on Oracle TIMESTAMP data type.

My problem is that I have another application that doesn't work with TIMESTAMP Oracle data type. It needs "DATE" type.

I tried to change the data type on the DB (manually), and I see that both applications will work (in our application, the user can insert at max minutes, so I don't lost any information).

So I'd like to know if there is any kind of setting that let me inform dotConnect to map DateTime property on Oracle DATE type instead of TIMESTAMP.
I don't want to do it for each property (like data attribute or special configuration for every property in the "OnModelCreating" event).

Thank you in advance.
by JoeRuspante
Mon 10 Sep 2012 10:58
Forum: dotConnect for Oracle
Topic: OracleEntityProviderConfig on 7.2.77.0
Replies: 4
Views: 1162

Re: OracleEntityProviderConfig on 7.2.77.0

I found the problem.

On Visual Studio I have 2 rows for each DLL.
If I use the first one, it won't work.
If I use the second one, it works...

Is it possible to know why I have 2 voices for each dll (and 1 don't work)?
by JoeRuspante
Mon 10 Sep 2012 10:51
Forum: dotConnect for Oracle
Topic: OracleEntityProviderConfig on 7.2.77.0
Replies: 4
Views: 1162

OracleEntityProviderConfig on 7.2.77.0

Hi.

I passed to the new version of dotConnect for Oracle and my solution now don't compile because don't find the OracleEntityProviderConfig.


If I try to write all the string by hand "Devart.Data.Oracle.Entity.Configuration" I found only "a, b, c" classes and not OracleEntityProviderConfig...


What's wrong?
The code I had could compile on the previous version of dotConnect (7.1.xx)

Thank you in advance