Search found 163 matches

by crazypit
Fri 16 Sep 2011 06:31
Forum: LinqConnect (LINQ to SQL support)
Topic: Different Execution Plans followed between Linq and SQL text
Replies: 3
Views: 1451

As i mentioned, the line of code that uses the LINQ method is replaced by the line of code that uses the ExecuteQuery. The datacontext is always different, and is disposed to a pool of connections.

I assume that the index is not used because i cannot think of something else for the delay. Fast value is 0.3 secs and slow value is 30 secs. Im asking if you think that something else is the problem.

An other reason about assuming that the index is not used, is the way i managed to overcome the problem by still using the LINQ implementation. I created a materialized view that has two columns. The Id column of the table that holds the CLOB value and an other column that is created by using the dbms_lob.substr(, 4000, 1) on the CLOB. Effectively i created a table with the value of the index. I just join the tables over the Id column and check the value on the materialized view table and not the original one. That is:

I had: (from objCustomer in dataContext.Customers
where objCustomer.Value.Substring(0,4000) == select objCustomer).ToList()

and went to:
(from objCustomer in dataContext.Customers
from objView in dataContext.MaterializedView
where objView.Value == && objCustomer.Id == objView.Id
select objCustomer).ToList()

Of course the query is not that simple, but the changes are as mentioned. The query runs in less than a second even if i just joined an other table to the equation.

As for the problem with the entity materialization, im fully aware of. The CLOB column is not present in the SELECT part. Anyway, this is not the problem as both queries are the same and project to the same List of Customers and therefore the entity materialization should be the same for both.
by crazypit
Wed 14 Sep 2011 09:43
Forum: LinqConnect (LINQ to SQL support)
Topic: Different Execution Plans followed between Linq and SQL text
Replies: 3
Views: 1451

Different Execution Plans followed between Linq and SQL text

Hello,

I seem to have a performance issue that you maybe help me with. At the system described in http://www.devart.com/forums/viewtopic.php?t=20504 i have a function-based index on a CLOB column in which i index the first 4000 characters in it. dbms_lob.substr(, 4000, 1). I have the bizarre situation where my application's LINQ compiled query DO NOT use the Index but when i run the generated SQL text query in SQL plus, everything works ok.

I use the DataContext.Log to get the SQL. When i run my application, at the line where the compiled query is called, the SQL text is written in my log very fast (i guess the precompilation works ok) and then, i guess, the query is run against the database. This way, the query does not use the index and takes about 30 secs.

Next test. I get the LINQ-generated SQL text from my log file (is it 100% sure that this is the correct SQL actually run against the database?) and run it in SQL plus. The query uses the index and takes about 0.3 secs.

Next test. I change the line of code in my application that calls the compiled query and use the ExecuteQuery Method projecting to the same type which is a list of Customer objects. So, from:

var customers = Queries.GetCustomers(dataContext, ).ToList()

i go to:
var customers = datacontext.ExecuteQuery("SQL Text Query")
The query again uses the index! I tried that a lot of times, and everytime i get the same results! I can't imagine what goes wrong...

Difference i can see, is that i use oci connection pooling in my application and from SQL plus i have to open a dedicated connection.

Can you think of something?
by crazypit
Tue 13 Sep 2011 09:17
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled AccessViolationException
Replies: 21
Views: 5269

Using version 2.50.30 of LinqConnect, i still get a lot of System.AccessViolationException errors with the stack:
at Devart.Data.Linq.Provider.ObjectReader`1[[System.Decimal, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].k()
at Devart.Data.Linq.Provider.k+a.d()
at Devart.Data.Linq.Provider.k.e()
at Devart.Data.Linq.Provider.DataProvider.Dispose(Boolean)
at Devart.Data.Linq.DataContext.Dispose()

Faulting module is OraOCIEI11.dll of my Instant Client installation.

Nowadays, i get 20 errors a day that crash my production application server and severely hinders functionality! It seems that the number of crashes is analogous to the work load of the server. In a few months, i will have serious problems getting my system not turned off by my clients! I need help!
by crazypit
Thu 04 Aug 2011 12:50
Forum: Entity Developer
Topic: Bug when updating Model from Database
Replies: 1
Views: 1326

Bug when updating Model from Database

Hello,
Using the latest LinqConnect version, when updating a model from an Oracle 11g database and for a CHAR(1) NOT NULL column that maps to a String property and its Default value is set to "3", i always get a synch mismatch with the following information :

DefaultValue(old='3', new="3") was changed.

Pay attention to the mismatch on the type of the quotes.

If i enclose the Default Value of the property of my class in single quotes, '3', everything works. If i set it to 3 without any quotes, i get the bug.
by crazypit
Wed 06 Jul 2011 07:59
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled AccessViolationException
Replies: 21
Views: 5269

All the information you need are present at the links provided in my first post. The first link points to an older post with info about the system.

Nevertheless, Direct mode cannot be used as this is a RAC system which is unsupported. Also, it is not so easy to just change the Oracle client on a production system!

In any case, the occasional error is not my problem. A proper application should handle these gracefully. My problem is that these errors are not propagated to my main thread and my whole CRM server goes down! Don't you think that all DB access related exceptions should be caught and handled??? This is my real problem! i don't really care about the occasional hickup. I need you to catch all these exceptions and send it to main thread.
by crazypit
Tue 05 Jul 2011 06:35
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled AccessViolationException
Replies: 21
Views: 5269

And an other yesterday:

Application: Exis.eXray.AppServerService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at Devart.Data.Oracle.OracleDataReader.Close()
at Devart.Data.Linq.Provider.ObjectReader`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Dispose()
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1)
at System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1)
at Exis.eXray.ClientsEngine.ClientsService.AgentCenter_GetUserAppointments(System.String, Int64, System.Collections.Generic.Dictionary`2 ByRef)
by crazypit
Fri 01 Jul 2011 07:28
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled AccessViolationException
Replies: 21
Views: 5269

Background Thread Unhandled AccessViolationException

Hello,

At the system described in http://www.devart.com/forums/viewtopic.php?t=20504 and using version 2.20.21 of LinqConnect i still get an AccessViolationException that crashes my CRM server.

Application: Exis.eXray.AppServerService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at Devart.Data.Linq.Provider.i+a.g()
at Devart.Data.Linq.Provider.i+a.b(Devart.Data.Linq.Provider.IConnectionUser)
at Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery, System.Object[], System.Object[], System.Object)
at Devart.Data.Linq.Provider.DataProvider.ExecuteAllQueries(CompiledQuery, System.Object[])
at Devart.Data.Linq.CompiledQuery.Invoke[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon, Int64)
at Exis.eXray.WorkflowEngine.WorkflowService.ProcessCaseInt(Int64)
at Exis.eXray.WorkflowEngine.WorkflowService.ProcessCase(Int64)

ALL exceptions are handled by my code effectively in ProcessCase(Int64) function.

This is another one that happened a few days before:

Application: Exis.eXray.AppServerService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at OciDynamicType.nativeOCILobGetLength(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, IntPtr, Int32 ByRef)
at OciDynamicType.OCILobGetLength(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, IntPtr, Int32 ByRef)
at Devart.Data.Oracle.i.k()
at Devart.Data.Oracle.OracleLob.ReadLobCache()
at Devart.Data.Oracle.i.b()
at Devart.Data.Oracle.as.q(Byte[], Int32, Int32)
at DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure, Devart.Data.Linq.Provider.b, Int32[])
at Devart.Data.Linq.Provider.EntityReader`3[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].b()
at Devart.Data.Linq.Provider.ObjectReader`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1)
at System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1)
at Exis.eXray.WorkflowEngine.WorkflowService.ExecuteEventAction(Exis.eXray.Domain.Event, Exis.eXray.Domain.Case, Exis.eXray.Domain.EventTypeAction)
at Exis.eXray.WorkflowEngine.WorkflowService.ExecuteMainAction(Exis.eXray.Domain.Event, Exis.eXray.Domain.Case)
at Exis.eXray.WorkflowEngine.WorkflowService.ProcessWorkflow(Exis.eXray.Domain.Case, Exis.eXray.Domain.Event)
at Exis.eXray.WorkflowEngine.WorkflowService.ProcessCaseInt(Int64)
at Exis.eXray.WorkflowEngine.WorkflowService.ProcessCaseOneWay(Int64)
by crazypit
Mon 16 May 2011 07:21
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled InvalidOperationException again
Replies: 3
Views: 1363

Background Thread Unhandled InvalidOperationException again

Hello,

Using the latest LinqConnect build 2.20.21, i still get the first unhandled exception as described in http://www.devart.com/forums/viewtopic.php?t=20504.

Application: Exis.eXray.AppServerService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
Stack:
at Devart.Common.DbConnectionInternal.d(System.Object)
at Devart.Common.DbConnectionPoolGroup.a(Devart.Common.DbConnectionPool)
at Devart.Common.DbConnectionPoolGroup.a(System.Object)
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading._TimerCallback.PerformTimerCallback(System.Object)


System is an Oracle 11.2.0.1. We do not use Direct mode. We use the default Devart pooling with min 10 max 100 connections for each of a number of 5-6 application domains loaded in a Windows Service process. Oracle client used, is an Oracle Instant Client version 11.2.0.1. Database and application server are 2 different Windows Server 2008 R2 64-bit machines.
by crazypit
Mon 09 May 2011 07:26
Forum: Entity Developer
Topic: Support for a single model connecting to multiple DB types
Replies: 6
Views: 2848

I use LinqConnect since its beginning and i want to play with Oracle 11g & MS SQL Server 2008.

I have an application which should be working with 2 different DB types, namely an Oracle 11g and an MS SQL Server 2008. I need to use the XML file mapping feature. Therefore, using a proper switch which denotes the DB type, my POCO LINQ entities should be mapped either to the one or the other DB type. This can be accomplished by loading the proper XML mapping file in the DataContext class.

Now, to my configuration, i only need to maintain ONE Entity model with all the .NET properties. Class names, Property names, .NET types etc. are (and should be) common for both databases. Now, for each of my two DB connections, a separate model (XML file?) should be maintained, along with the DB specific info as Column name and DB Type. What i effectively propose is that a 2-level configuration should be maintained. One for the Object part of the ORM mapping and one for the Relational part of the ORM mapping FOR EACH DB TYPE. When i need to synchronize with a database, i should select the connection upon which it should take place. The same goes when i need to generate code: The difference between the 2 DB types will only be the XML mapping file! The DataContext class differentiates only at the static mappingSource variable which can be easily custom configured to use the proper mapping file, and the parameterless constructor which is pretty much useless.

It seems to me that you have all the necessary components to properly accomplish a complete DB-agnostic entity model generation, you just need to re-structure your architecture a little bit.
by crazypit
Thu 28 Apr 2011 13:43
Forum: Entity Developer
Topic: Support for a single model connecting to multiple DB types
Replies: 6
Views: 2848

Support for a single model connecting to multiple DB types

Hello,

I tried the latest beta of Entity Developer and i cannot seem to find a proper way to maintain a single model for multiple DB types (specifically an Oracle 11 and a MS SQL Server 2008). From what i've seen so far, it seems that you are very close to accomplish this, but for some reason, fail to do so. I will offer my thoughts on this and hope that you fix it during the beta.

What you support now is a model which can be synchronized to a DB through a SINGLE connection. Specific DB info (namely the Server Data Type) is maintained in the model and synchronized through this single connection. If someone wants to change the DB, she first needs to change the connection type, then re-synchronize so that the model gets the new server data types (not always the case. some bugs are present there...) and generate the code. In any case, it is impossible to keep the SAME model! The best one can do is to save the model with an other name and thus maintain 2 models for the different connections.

It is apparent, that a simple change in the architecture, can solve the problem. A single model is should be maintained with NO server info. User should be able to define one or more DB connections for this model. When the user needs to synchronize with a database (Update model from database, update database from model), he selects the connection he prefers and performs the synch. Apparently, the same DB-->model translation should be performed even if the DB type is different. The server data types are NOT required to be maintained in the model. When the user needs to generate Entities, again he selects the connection type and then the correct server data types are generated either in the entity attributes or in the xml mapping file. This is the only place where the server data types are required.
by crazypit
Mon 18 Apr 2011 08:06
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled Exception 2
Replies: 6
Views: 1454

I got one of these again last Saturday using version 2.20.19.
by crazypit
Wed 13 Apr 2011 14:37
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled InvalidOperationException
Replies: 15
Views: 22538

A single ToList() compiled query is performed:

List parameterMappings = ParameterMapping.WorkflowService_ExecuteEventAction(dataContext, eventTypeAction.Id).ToList();

public static Func>
WorkflowService_ExecuteEventAction =
CompiledQuery.Compile(
(ExrayDataContext dataContext, long EventTypeActionId) =>
from parameterMapping in dataContext.ParameterMappings
from functionParameter in dataContext.FunctionParameters
where parameterMapping.FpId == functionParameter.Id
&& parameterMapping.EtaId == EventTypeActionId
orderby functionParameter.Type_Str
orderby functionParameter.Sort
select parameterMapping);

It is 100% SURE, that a possible exception bubbles up and handled by my application. This code is called maybe 50 times/sec and exceptions are caught and logged all the time.
by crazypit
Wed 13 Apr 2011 13:44
Forum: LinqConnect (LINQ to SQL support)
Topic: Bad SQL generated through LINQ to Oracle
Replies: 3
Views: 1682

Hello,

anything new on that? It's been over a month.
by crazypit
Tue 12 Apr 2011 12:16
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled InvalidOperationException
Replies: 15
Views: 22538

Using the latest 2.20.19 version of LinqConnect, i got the following unhandled exception:

Application: Exis.eXray.AppServerService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at Devart.Data.Oracle.OracleDataReader.Close()
at Devart.Data.Linq.Provider.ObjectReader`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Dispose()
at Devart.Data.Linq.Provider.ObjectReader`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1)
at System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1)
at Exis.eXray.WorkflowEngine.WorkflowService.ExecuteEventAction(Exis.eXray.Domain.Event, Exis.eXray.Domain.Case, Exis.eXray.Domain.EventTypeAction)
at Exis.eXray.WorkflowEngine.WorkflowService.ExecuteOpenCloseActions(Exis.eXray.Domain.Event, Exis.eXray.Domain.Case)

At least, is there a way for these exceptions to somehow get forwarded to application's main thread so that i can catch them? For me, it is not really a problem if i can handle them. Unless of course something gets really corrupted and should get fixed.
by crazypit
Mon 11 Apr 2011 06:38
Forum: LinqConnect (LINQ to SQL support)
Topic: Background Thread Unhandled Exception 2
Replies: 6
Views: 1454

2.20.11