Search found 20 matches

by mpovidlov
Fri 23 Oct 2009 03:04
Forum: dotConnect for Oracle
Topic: deployment problem again
Replies: 1
Views: 1550

deployment problem again

I am trying to deploy an application on a shared drive of our intranet.
I am using Entity Framework with Oracle.
I added the config file with this:

Code: Select all


  
    
      
      
  
  


I checked that the licenses.licx file has correct version. I copied Devart.Data.Dll (ver. 5.0.7.0)
Devart.Data.Oracle.dll (5.25.42.0)
Devart.Data.Oracle.Entities.dll(5.25.42.0)
I also added two XML files generated by compiler (Devart.Data.xml Devart.Data.Oracle.xml ), though they refer to Devart.Data of version 5.0.1.0.
When I start a program on a computer with Oracle installed, it just hangs...
It was hanging before and I found that the license file was from wrong version (which is frustrating without getting any message), I fixed that and it started to work. This time (with yet newer version of dotConnect) this trick does not help anymore. What am I missing?
Thanks

Update:
The program works from the local drive without Devart installed (the client 's machine). When I run it from the shared drive, it hangs (badly, need to restart computer) on this line:

Code: Select all

                    contextInstance = new Entities( ConnectString );
                    contextInstance.Connection.Open(); <---hangs indefinitely
When run from the local directory, it produces Symantec's Antivirus message about blocking program access to a network, though it reads everything from the database successfully.
There is no problem when I use the context in a usual way:

Code: Select all

var context = new Entities();
var q = from a in context.Table1 select a;
It also runs from the shared drive on a computer with dotConnect installed.
by mpovidlov
Wed 09 Sep 2009 01:02
Forum: dotConnect for Oracle
Topic: LINQ to Oracle or Entity Framework.
Replies: 1
Views: 1648

LINQ to Oracle or Entity Framework.

Please help me decide. I cannot choose between the two technologies:
Entity Framework:
pros: Integrated into Visual studio design tools, the library references are added automatically.
cons: Cannot handle IN clause.

LINQ to SQL:
pros: can handle the IN clause
cons: library references should be added manually,
once the classes are generated and you decide to add more tables to generated context classes you have to start from sratch by again choosing all tables (and I am choosing from hundreds of them).

Am I doing something wrong?
BTW, which one supports Oracle's hints? I have to use them sometimes.
Thanks
by mpovidlov
Wed 03 Jun 2009 22:25
Forum: dotConnect for Oracle
Topic: Insert rows with incrementing primary key
Replies: 3
Views: 3151

Well, I created Oracle functions GET_NEXT_CUSTOMER_ID() and GET_NEXT_DEPT_ID(). The Entity Developer generated corresponding methods after I dragged the stored functions to the context. Somehow it did not recognize that they are functions, not procedures and I had to change the Method Type from StoredProcedure to ScalarValuedFunction manually, otherwise they would not work.
Next, I tried to delay committing into the database until the last moment and wanted to get the next customer_id for each customer by the generated method, assign it to a customer, add the customers to the context. I wanted to call SubmitChanges after the main loop of adding customers. But I get the following exception: Can not insert entity with the same key if key is not database generated.
I was not using the code you suggested (I switched to LINQ to SQL). My path seemed to be straightforward (well, it was not customer, it was marker):

Code: Select all

                    var nextMarkerId = GetNextMarkerId();
                    var marker = new Marker
                                     {...
                                         MarkerId = nextMarkerId,
                                      ... 
                                      }
                    ContextM.Markers.InsertOnSubmit( marker );

On the next InsertOnSubmit that comes in a loop it would throw the exception. So as a result I have to SubmitChanges every Insert which does not let me to commit only at the end. What did I miss?
Thanks
by mpovidlov
Fri 29 May 2009 22:40
Forum: dotConnect for Oracle
Topic: Insert rows with incrementing primary key
Replies: 3
Views: 3151

Insert rows with incrementing primary key

I want to insert rows in a table that has a PK column (CUSTOMER_ID). I created a trigger that will read nextval from an Oracle sequence (ID_SEQ) and assign it to PK. This approach forces me to commit on every record. Is there a way to read the nextval manually using the Entities' database connection either by plain SQL (select id_seq.nextval from dual) or by some generated method? This would let me saving the changes at the very end.
by mpovidlov
Tue 26 May 2009 18:42
Forum: dotConnect for Oracle
Topic: Problem updating the model from database
Replies: 1
Views: 1593

Problem updating the model from database

I think I found a problem in updating the existing model from database.
Suppose I have 3 tables: EMPLOYEE, ADDRESS, DEPARTMENT. Suppose order can contain only one product. If I first create an Entity data model with just two tables EMPLOYEE and ADDRESS (or EMPLOYEE and DEPRATMENT, or add all three tables) everything is fine. If I first use EMPLOYEE and ADDRESS to create the model and then add ("Update model from database") one more table, I get the error 3007. I understand that a property (EMPLOYEE.DEPARTMENT_ID) that existed as a scalar property is now associated with a set (Deparment has many employees). Somehow, if I create the model with all three tables, all associations are generated correctly. If I add tables incrementally, I get the error. I compared the resulting edmx files (after heavy reordering the tags without changing the structure) and found that clearing two lines that refer to the scalar property solves the problem. Are you aware of this?
Thanks
by mpovidlov
Thu 21 May 2009 17:27
Forum: dotConnect for Oracle
Topic: Entity Data Model Wizard: reuse a data connection to Oracle
Replies: 1
Views: 1882

Entity Data Model Wizard: reuse a data connection to Oracle

I am adding a new ADO.NET Entity Data Model. I am getting to a screen "Choose Your Data Connection". In the list of available connections that I created before I see an entry that, when I was creating it, does not store password neither in the connection string nor in App.Config. I was able to use this connection before, right after I had created it and had been shown a dialog with "Test connection" button. I had set the password in my code. Now, when attemtping to reuse this connection in another project and providing the password in the dialog box (this dialog box disappears in the following attempts, btw), I get an error "Devart.Data.Oracle.OracleException, error message ORA-01005: null passord given; logon denied". I cannot do anything about it, I have to create a new (duplicate) connection that will allow me to get through. Is this a Devart's problem?
Thanks
by mpovidlov
Thu 21 May 2009 00:05
Forum: dotConnect for Oracle
Topic: Not Specifying the Schema Name
Replies: 9
Views: 2485

I have an "opposite" question. I use two database instances. Tables in both of them sometimes have the same name. I'd like to read from both instances in the same program, therefore I am trying to generate two ADO.NET Entitity Data models, one per each database connection.
As a result the generated classes are placed into the same namespace (named after my applicatoin name, WindowsFormsApplication1) and their methods clash because the tables and their columns have identical names.
What can I do to keep the generated classes in different namespaces. Should I just rename the namespaces in the model files or there is another more elegant solution?
by mpovidlov
Thu 12 Mar 2009 23:01
Forum: dotConnect for Oracle
Topic: Publishing an application
Replies: 11
Views: 5525

It actually did not work the way you suggested, I had to modify it to
to make it work. I hope I did it right.
by mpovidlov
Thu 12 Mar 2009 00:54
Forum: dotConnect for Oracle
Topic: Using Entities classes with DataGridView
Replies: 1
Views: 1721

Using Entities classes with DataGridView

It is very easy to display and edit a database table represented by Entity class in DataGridView:

Code: Select all

var context = new Entities();
dataGridView1.DataSource = context.EMPLOYEE;
But when one of the columns is an FK to another table (like Department) the DataGrid would display the whole Entity Department in that column. As a result it does not show anything. I am interested in the FK value (DepartmentID) which is still a part of Employee table. Is it possible to tell the DataGrid to display the DepartmentID instead of the whole Department?
Thanks
by mpovidlov
Fri 06 Mar 2009 16:18
Forum: dotConnect for Oracle
Topic: Publishing an application
Replies: 11
Views: 5525

Thank you, this is very useful. Probably this should go to FAQ
by mpovidlov
Thu 05 Mar 2009 19:30
Forum: dotConnect for Oracle
Topic: Publishing an application
Replies: 11
Views: 5525

BTW, Devart.Data from version 5.0.22 is not listed in the .NET references (version 5.0.1.0 is shown only, a leftover from previous installation?). I can see Devart.Data.Oracle.Entity and Devart.Data.Oracle with version 5.0.22 shown in the list for references. Plus, I can see the fresh (Feb.16 2009) Devart.Data.DLL in Devart... folder. Probably there is a problem with installation. (The uninstall of previous version hung at the end).
Just letting you know.
by mpovidlov
Thu 05 Mar 2009 15:46
Forum: dotConnect for Oracle
Topic: Publishing an application
Replies: 11
Views: 5525

Thanks, I'll try that, but this seems to be only a partial solution. I need to deploy my application to multiple unknown computers. What if some of them have this lines in machine.config and some do not. Who knows, maybe some of my clients have dotConnect installed (if it becomes so popular :0))?
by mpovidlov
Thu 05 Mar 2009 04:22
Forum: dotConnect for Oracle
Topic: Publishing an application
Replies: 11
Views: 5525

I have a problem deploying the application. As was recommended, I modified app.config by adding

Code: Select all

  
    
    
  
  
After having hard time with licensing issue (resolved by Tools/Oracle/License information) I now get an error message when I run the program on my computer (where dotConnect has been installed):

Code: Select all

Column 'InvariantName' is constrained to be unique. Value 'Devart.Data.Oracle' is already present.
At the same time, the same program will run on a client's computer (who does not have dotConnect installed).
If I remove the new lines from app.config, it will now run on my computer but will complain on the client's one. Is there solution to this?
Thanks
by mpovidlov
Wed 04 Feb 2009 03:55
Forum: dotConnect for Oracle
Topic: Unload large context objects. Is it possible?
Replies: 1
Views: 1881

Unload large context objects. Is it possible?

I am loading large blobs (~10Mb) to the database using Entities.
I create an object that represents a row in the table. Then I add it using the generated method to the context, then I call SaveChanges() and then I do not need to keep it in memory, otherwise I will run out of memory.
Is it possible to unload the stored object from memory right after saving it to the database?
Thanks
by mpovidlov
Sat 31 Jan 2009 01:12
Forum: dotConnect for Oracle
Topic: Entities: deferred loading?
Replies: 1
Views: 1761

Entities: deferred loading?

I am using ADO.NET Entity model with Oracle.
When I query a table, its child entities are left unloaded. I could not find how I could enforce loading. Documentation on Entities mention DeferredLoadingEnabled property but I could not find it in the generated Entity class.
Probably it is something easy. Note: I process huge amounts of data and do not want to load all the data, I need a few records but loaded completely.
Thanks