odp.net

ODP.NET connection pooling: How to tell if a connection has been used

无人久伴 提交于 2019-11-29 12:02:18
I'm modifying a Winforms app to use connection pooling so data access can occur in background threads. The business logic is implemented in PL/SQL and there are a couple of security related stored procedures that have to be called in order to make use of the business logic. What I need is a way to tell if the connection has been used without a round-trip to the database. I don't think I can keep track of them in a HashSet because I doubt Equals or even ReferenceEquals could be relied upon. Any ideas? EDIT: Just to be clear, I plan to use ODP.NET's built-in connection pooling mechanism. If I

Can an Oracle stored procedure that has a nested table parameter be called from ODP.NET?

。_饼干妹妹 提交于 2019-11-29 11:57:01
I've got a stored procedure that has a couple parameters that are nested tables. CREATE TYPE FOO_ARRAY AS TABLE OF NUMBER; CREATE TYPE BAR_ARRAY AS TABLE OF INTEGER; CREATE PROCEDURE Blah( iFoos IN FOO_ARRAY, iBars IN BAR_ARRAY, oResults OUT SOMECURSORTYPE ) AS BEGIN OPEN oResults FOR SELECT * FROM SomeTable T JOIN TABLE(iFoos) foos ON foos.column_value = T.foo JOIN TABLE(iBars) bars ON bars.column_value = T.bar; END Using ODP.NET (Oracle.DataAccess.dll), is there a way to call this stored procedure and pass arrays into these parameters? The only way I've found to pass arrays is if the

How to clear the ODP.NET connection pool on connection errors?

不想你离开。 提交于 2019-11-29 11:52:31
问题 I'm using NHibernate and ODP.NET to connect to a Oracle 11g database. Of course there can be connection errors (network failure, DB down, ...). I'm handling all these exceptions in my code, so no problem there. But of course the user can retry his actions (maybe it was just a short network failure), and there comes my problem: ODP.NET is using connection pooling by default. No problem with that usually, but when the user retries an action after a connection error, NHibernate gets an invalid

Oracle ODP.Net and EF CodeFirst - edm.decimal error

雨燕双飞 提交于 2019-11-29 11:15:59
I have the following simple entity: public class Something{ [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public int ID { get; set; } public string NAME { get; set; } public int STATUS { get; set; } } As you can see, I do not want the ID is generated from the database but I'm going to enter manually. This my DbContext class: public class MyCEContext : DbContext { ... public DbSet<Something> Somethings { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { string dbsch = "myce"; modelBuilder.Entity<Something>().ToTable("SOMETHING", dbsch); } } There is

ODP.NET How to pass array of strings to an Oracle Stored procedure?

与世无争的帅哥 提交于 2019-11-29 11:12:36
There's numerous question and confusing docs on the subject, but no luck so far. I've the following PL/SQL stored procedure; PROCEDURE PS_test( Liste1 Listcar, Liste2 Listcar, P_CURS_MESSAGE out CURSOR_REF_TYP ) Where the type Listcar is the following: TYPE Listcar IS VARRAY(100) OF VARCHAR2(50); Here is what I'm trying so far: string[] list = { "name1", "name1" }; OracleParameter oParam = (OracleParameter)myOracleCommand.CreateParameter(); oParam.ParameterName = "Liste1"; oParam.UdtTypeName = "LISTCAR"; oParam.Value = list; oParam.Direction = ParameterDirection.Input; myOracleCommand

When opening an oracle connection, connection object is null

青春壹個敷衍的年華 提交于 2019-11-29 10:55:58
I am trying to connect to an oracle database in my controller: using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; // Other code OracleConnection con; con = new OracleConnection(); con.ConnectionString = "DATA SOURCE=<DSOURCE_NAME>;PERSIST SECURITY INFO=True;USER ID=******;PASSWORD=*******"; con.Open(); The connection test is successful and I can navigate through tables, functions, etc. in Visual Studio's Server Explorer, but when I try to execute the above code I consistently get [NullReferenceException: Object reference not set to an instance of an object.] on the con.Open(); line

Randomly getting ORA-08177 with only one active session

拟墨画扇 提交于 2019-11-29 09:08:21
I'm running a program that creates a table and then inserts some data. This is the only program that accesses the database. I'm getting ORA-08177 randomly. Actual code is somewhat complex, but I've written a simple program that reproduces this behavior. using System; using System.Data; using Oracle.DataAccess.Client; namespace orabug { class Program { private const string ConnectionString = ""; // Valid connection string here // Recreates the table private static void Recreate() { using (var connection = new OracleConnection(ConnectionString)) { connection.Open(); using (var command =

ODP.Net Managed Driver - ORA-12704: character set mismatch in generated code

╄→гoц情女王★ 提交于 2019-11-29 07:24:31
I am currently using the Oracle Managed Driver (v12.1.2400) as my Entity Framework driver, and am currently seeing a ORA-12704: character set mismatch error during execution. The LINQ->SQL code I am using is as follows: from c in CUSTOMER.AsNoTracking() where c.ACCOUNT.Contains("DE") && c.DELETED == "N" orderby (c.FORENAME + c.SURNAME) select new { c.ACCOUNT, c.FORENAME, c.SURNAME}) and this is creating the following SQL: SELECT "Project1"."C2" AS "C1", "Project1"."ACCOUNT" AS "ACCOUNT", "Project1"."FORENAME" AS "FORENAME", "Project1"."SURNAME" AS "SURNAME" FROM ( SELECT( (CASE WHEN ("Extent1"

How to execute a update statement using Oracle ODP.Net in C#

好久不见. 提交于 2019-11-29 06:58:51
I am using Oracle.DataAccess.Client to work with Oracle database in my ASP.Net application. There is no help documentation in MSDN for ODP.Net and Oracle 's documentation is really really bad. I am not able find the answer to this simple question. Is it not possible to execute a simple update statement without having to build a dataset object and updating the dataset ? How to execute an update statement using Oracle ODP.Net in C# ? I will need to check the exact syntax, but here is some quick code off the top of my head using (OracleConnection con = new OracleConnection(...)) { con.Open();

ODP.NET and ClickOnce possible?

这一生的挚爱 提交于 2019-11-29 04:38:51
We have a sqlserver (WinForms) application that is deployed with ClickOnce that talks directly to the database. If we are forced to port it to oracle, can ODP.NET be used with ClickOnce. (The users may not have admin rights on their PCs) Background This data import application is used by a handful of users at each customer’s site it uses intergraded logon to connect to SQL Server. Most users access the system var an Asp.net application, or a WinForms (clickOnce) application that talks to a web service. see also " How to write a .Net application that works with both SqlServer and Oracle " EDIT: