Thank you for checking into this issue. I believe the parsing issue is on the naming for the bind variable. For a web application, I'm using a connection pool with of course closing the connection when completing a transaction or query. Since this is a web based application, I'm not cannot just close the web based application. The following is a sample of a source code where a button on a web page calls this method in C#:
public List fetchQryLINQ(DateTime param1
, DateTime param2)
{
DataSourceModel1.XEntities db = null;
try
{
string sConnStrg = ConfigurationManager.ConnectionStrings["MyConnString1"].ConnectionString;
db = new DataSourceModel1.XEntities(sConnStrg);
var myList = (from a in db.XTxns
where a.EventTimestamp >= param1
&& a.EventTimestamp = :p__linq__1) AND ("Extent1".EVENT_TIMESTAMP = :p__linq__3) AND ("Extent1".EVENT_TIMESTAMP <= :p__linq__4)
-- -1 row(s) affected.
The dbMonitor shows the connection as closed after each above query transaction.
The problem is the unique bind variable. Oracle cannot reused the first query because the variable is different. Do you see the issue?
Search found 6 matches
- Fri 18 Dec 2009 15:08
- Forum: LinqConnect (LINQ to SQL support)
- Topic: LINQ to SQL for Oracle and bind variable naming
- Replies: 4
- Views: 3354
- Sat 05 Dec 2009 22:03
- Forum: LinqConnect (LINQ to SQL support)
- Topic: LINQ to SQL for Oracle and bind variable naming
- Replies: 4
- Views: 3354
LINQ to SQL for Oracle and bind variable naming
Hi all,
In C#, when using LINQ to SQL for Oracle database (v5.25.42.0) with ASP.NET MVC 3.5, the bind variable changed on every execution. On the first execution of the LINQ to SQL query with the where clause, the DBMonitor shows the bind variable of :p__linq__1. On the second execution of the same exact LINQ to SQL query during the same session, the DB Monitor shows the bind variable of :p__linq__2. This name should stay the same as :p__linq__1 not :p__linq__2. Otherwise, the Oracle database treats the two sqls as two separate executions. This is a significant performance issue. Is there a way to control the naming of the bind variable? Thanks in advance!
see this article for details: http://www.oracle-base.com/articles/mis ... iables.php
In C#, when using LINQ to SQL for Oracle database (v5.25.42.0) with ASP.NET MVC 3.5, the bind variable changed on every execution. On the first execution of the LINQ to SQL query with the where clause, the DBMonitor shows the bind variable of :p__linq__1. On the second execution of the same exact LINQ to SQL query during the same session, the DB Monitor shows the bind variable of :p__linq__2. This name should stay the same as :p__linq__1 not :p__linq__2. Otherwise, the Oracle database treats the two sqls as two separate executions. This is a significant performance issue. Is there a way to control the naming of the bind variable? Thanks in advance!
see this article for details: http://www.oracle-base.com/articles/mis ... iables.php
- Fri 18 Sep 2009 12:35
- Forum: dotConnect for Oracle
- Topic: ORA-01821 date format not recognized
- Replies: 4
- Views: 4037
value of the timestamp with time zone
15-DEC-04 10.37.00.000000 PM AMERICA/BOISE
- Tue 15 Sep 2009 11:07
- Forum: dotConnect for Oracle
- Topic: ORA-01821 date format not recognized
- Replies: 4
- Views: 4037
ORA-01821 date format not recognized
ORA-01821 date format not recognized
Ran into this error in run time when accessing Oracle database columns containing timestamp with time zone in the ASP.Net web page (View page of ASP.NET MVC). What am I missing? I'm using docConnect for Oracle (Direct) version 5.25.42.0. The stack trace is:
at Devart.Data.Oracle.OracleTimeStamp.a(String A_0, SByte& A_1, SByte& A_2)\r\n at Devart.Data.Oracle.OracleTimeStamp..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 nanosecond, String timeZone, OracleDbType dbType)\r\n at Devart.Data.Oracle.ae.m(Byte[] A_0, Int32 A_1, Int32 A_2)\r\n at Devart.Data.Oracle.af.g(Byte[] A_0, Int32 A_1, Int32 A_2)\r\n at Devart.Data.Oracle.OracleDataReader.GetDateTime(Int32 i)\r\n at Devart.Data.Oracle.Entity.d.a.b.a(Int32 A_0)\r\n at Devart.Common.Entity.c.a.a.GetValue(Int32 ordinal)\r\n at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)\r\n at System.Data.Common.Internal.Materialization.Shaper.GetColumnValueWithErrorHandling[TColumn](Int32 ordinal)\r\n at lambda_method(ExecutionScope , Shaper )\r\n at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)\r\n at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()\r\n at ASP....
Ran into this error in run time when accessing Oracle database columns containing timestamp with time zone in the ASP.Net web page (View page of ASP.NET MVC). What am I missing? I'm using docConnect for Oracle (Direct) version 5.25.42.0. The stack trace is:
at Devart.Data.Oracle.OracleTimeStamp.a(String A_0, SByte& A_1, SByte& A_2)\r\n at Devart.Data.Oracle.OracleTimeStamp..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 nanosecond, String timeZone, OracleDbType dbType)\r\n at Devart.Data.Oracle.ae.m(Byte[] A_0, Int32 A_1, Int32 A_2)\r\n at Devart.Data.Oracle.af.g(Byte[] A_0, Int32 A_1, Int32 A_2)\r\n at Devart.Data.Oracle.OracleDataReader.GetDateTime(Int32 i)\r\n at Devart.Data.Oracle.Entity.d.a.b.a(Int32 A_0)\r\n at Devart.Common.Entity.c.a.a.GetValue(Int32 ordinal)\r\n at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)\r\n at System.Data.Common.Internal.Materialization.Shaper.GetColumnValueWithErrorHandling[TColumn](Int32 ordinal)\r\n at lambda_method(ExecutionScope , Shaper )\r\n at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)\r\n at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()\r\n at ASP....
- Mon 14 Sep 2009 16:27
- Forum: Entity Developer
- Topic: The value of EntityCommand.CommandText is not valid
- Replies: 3
- Views: 8734
The value of EntityCommand.CommandText is not valid
Stored procedure calls from ASP.Net to the Entity Framework model is generated incorrectly from Entity Developer.
In version, 2,20.37, of Entity Developer, I created from database two objects- a simple table and a simple package (Oracle) ..._LOG_PKG.ADD_ERROR_LOG. Within this model, I created a method from the package called AddErrorLog. Next, I select generate from the pull down menu (Project->Generate). Next, I add the *model.cs file to my new ASP.NET MVC project under the Models folder. Next, I add the 3 associated files ( *model.csdl, *model.msl, *model.ssdl).
Within my code, I call the model's entitites -
XYZmodel.XYZEntities db = new XYZmodel.XYZEntities();
db.AddErrorLog(x,y,z);
Unfortunately, at run time, the system threw an error:
System.InvalidOperationException was unhandled by user code
Message="The value of EntityCommand.CommandText is not valid for a StoredProcedure command. The EntityCommand.CommandText value must be of the form 'ContainerName.FunctionImportName'."
Source="System.Data.Entity"
StackTrace:
at System.Data.Common.Utils.CommandHelper.ParseFunctionImportCommandText(String commandText, String defaultContainerName, String& containerName, String& functionImportName)
at System.Data.EntityClient.EntityCommand.DetermineFunctionImport()
at System.Data.EntityClient.EntityCommand.MakeCommandTree()
at System.Data.EntityClient.EntityCommand.CreateCommandDefinition()
at System.Data.EntityClient.EntityCommand.TryGetEntityCommandDefinitionFromQueryCache(EntityCommandDefinition& entityCommandDefinition)
at System.Data.EntityClient.EntityCommand.GetCommandDefinition()
at System.Data.EntityClient.EntityCommand.InnerPrepare()
at System.Data.EntityClient.EntityCommand.Prepare()
at System.Data.EntityClient.EntityCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.EntityClient.EntityCommand.ExecuteScalar[T_Result](Func`2 resultSelector)
at System.Data.EntityClient.EntityCommand.ExecuteNonQuery()at XYZmodel.XYZEntities.AddErrorLog(.....
This issue is due to incorrect text in the *model.cs where the command.CommandText = @"ADD_ERROR_LOG" should be command.CommandText = @"XYZEntities.AddErrorLog" as mapped in the *model.csdl
See http://social.msdn.microsoft.com/Forums ... 8952508ba7 for details (located at the end of the blog).
For now, I must manually edit the *model.cs file to map to the correct entity. Is there a fix available for this issue or is there a switch or setting that I overlook? Please advise.
In version, 2,20.37, of Entity Developer, I created from database two objects- a simple table and a simple package (Oracle) ..._LOG_PKG.ADD_ERROR_LOG. Within this model, I created a method from the package called AddErrorLog. Next, I select generate from the pull down menu (Project->Generate). Next, I add the *model.cs file to my new ASP.NET MVC project under the Models folder. Next, I add the 3 associated files ( *model.csdl, *model.msl, *model.ssdl).
Within my code, I call the model's entitites -
XYZmodel.XYZEntities db = new XYZmodel.XYZEntities();
db.AddErrorLog(x,y,z);
Unfortunately, at run time, the system threw an error:
System.InvalidOperationException was unhandled by user code
Message="The value of EntityCommand.CommandText is not valid for a StoredProcedure command. The EntityCommand.CommandText value must be of the form 'ContainerName.FunctionImportName'."
Source="System.Data.Entity"
StackTrace:
at System.Data.Common.Utils.CommandHelper.ParseFunctionImportCommandText(String commandText, String defaultContainerName, String& containerName, String& functionImportName)
at System.Data.EntityClient.EntityCommand.DetermineFunctionImport()
at System.Data.EntityClient.EntityCommand.MakeCommandTree()
at System.Data.EntityClient.EntityCommand.CreateCommandDefinition()
at System.Data.EntityClient.EntityCommand.TryGetEntityCommandDefinitionFromQueryCache(EntityCommandDefinition& entityCommandDefinition)
at System.Data.EntityClient.EntityCommand.GetCommandDefinition()
at System.Data.EntityClient.EntityCommand.InnerPrepare()
at System.Data.EntityClient.EntityCommand.Prepare()
at System.Data.EntityClient.EntityCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.EntityClient.EntityCommand.ExecuteScalar[T_Result](Func`2 resultSelector)
at System.Data.EntityClient.EntityCommand.ExecuteNonQuery()at XYZmodel.XYZEntities.AddErrorLog(.....
This issue is due to incorrect text in the *model.cs where the command.CommandText = @"ADD_ERROR_LOG" should be command.CommandText = @"XYZEntities.AddErrorLog" as mapped in the *model.csdl
See http://social.msdn.microsoft.com/Forums ... 8952508ba7 for details (located at the end of the blog).
For now, I must manually edit the *model.cs file to map to the correct entity. Is there a fix available for this issue or is there a switch or setting that I overlook? Please advise.
- Mon 14 Sep 2009 14:42
- Forum: Entity Developer
- Topic: The specified metadata path is not valid
- Replies: 41
- Views: 35614
Still getting this error - The specified metadata..not valid
I created a new ASP.NET MVC project, within this project, I copied the cs file from the result of the generate process in Entity Developer into the Models folder. Next, I copied the remaining files, *model.csdl, *model.msl, *model.ssdl, into the root directory of the project. Next, I created a repository class file in the Models folder to call a stored procedure function within the model. Next, in the Controllers-> HomeController.cs file, within the Index method, I added a call to the repository class. Everything compiles fine without any error. However, at run time, with the latest build, 5.25.42.0, of dotConnect for Oracle Professional Setup, I'm getting this error:
System.Data.MetadataException was unhandled by user code
Message="The specified metadata path is not valid. A valid path must be either an existing directory, an existing file with extension '.csdl', '.ssdl', or '.msl', or a URI that identifies an embedded resource."
Source="System.Data.Entity"
StackTrace:
at System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.EntityClient.EntityConnection.SplitPaths(String paths)
at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor)
at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)...
The above work around is not working for me in ASP.NET MVC project. Am I missing something with the path of the meta data files? Is there an update to the Entity Devleoper with this installation package or is that separate? Please advise.
Thanks!
System.Data.MetadataException was unhandled by user code
Message="The specified metadata path is not valid. A valid path must be either an existing directory, an existing file with extension '.csdl', '.ssdl', or '.msl', or a URI that identifies an embedded resource."
Source="System.Data.Entity"
StackTrace:
at System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.EntityClient.EntityConnection.SplitPaths(String paths)
at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor)
at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)...
The above work around is not working for me in ASP.NET MVC project. Am I missing something with the path of the meta data files? Is there an update to the Entity Devleoper with this installation package or is that separate? Please advise.
Thanks!