As a predefined conditions I have multiple database sources to deal with.
Also I have a UDT – user defined types objects in part of this databases ( the UDT’s also have children inside) .
As a methodology I am a believer of using the ORM-object relational mapping to connect to DB’s .
In the past I’ve successfully implemented Fluent NHibernate library to connect to Oracle.
I’ve found a workaround for the Multiple Databases , even though the solution may be more elegant in future.
Nevertheless , I still can’t find a solution for mapping the UDT’s .
I think that it should be something like implementation of IUserType or ICompositeUserType .
If there is a known framework presenting option for a full ORM , including UDT’s handle it also can be a solution in our case.
I’ve checked out the EF of oracle (that is very premature) and also DevArt (that doesn’t handle UDT’s) as a possible solutions.
The ODP.Net is the only possible way right now and it’s not too friendly for the developers to use – no LINQ support , no context to begin with.
If you or any of your colleagues can help with some samples of the implementation of this kind of mapping it will be very appreciated.
I feel your pain, working with ODP.NET is not a pleasant experience at all. DevArt dotConnect supports UDT's. DevArt Objects documentation
Related
I have a spring project with many Entities and a complex relationship between entities. I would like to automatically find the indexes that are missing so that I could create those indexes. Are there any tools that help in achieving this? We are using Hibernate ORM and Oracle Database.
There is a new useful feature in Hibernate: SLOW_QUERY_LOG(LOG_QUERIES_SLOWER_THAN_MS). It would help you if it really worked (HHH-13928)
There is cool (but very expensive) tool Dynatrace, which can tell you relation between a slow REST API call and particular slow SQL
And then there are Oracle's native tools like Diagnostic pack and Tunning pack. But those will not show you relation between slow SQL and piece in you code which called it.
There is common issued when there are missing indexes on FK keys. In most cases those are a must. https://www.orafaq.com/node/2935
I am looking for tutorial or sample for Dapper using token based authentication in web api 2. I appreciate if anyone can suggest where to start, I have found tutorial in http://www.c-sharpcorner.com/UploadFile/ff2f08/token-based-authentication-using-Asp-Net-web-api-owin-and-i/ but the sample is using EF and I havent tried using EF, but dapper also I am using MySQL for my database. Thanks in advance and good day.
Dapper is a very different tool to EF (which is the DbContext described in your step 3 / step 4). It simply will not be compatible with those steps, and isn't designed to be used with those steps.
But here's the thing: dapper is just a tool. EF is just a tool. It is ok to use more than one tool. If it suits your purposes, then use EF to do one set of jobs (for example, to help you use a particular library that is designed with that in mind), and use another tool (such as dapper) elsewhere in the same project. That's OK. No one will mind.
If you really really don't want to use EF at all, then you'll need to find out everything that the library needs to support what you are doing, and implement it manually. If the library is designed around IQueryable<T> etc, then this may be very difficult.
I need to develop a program that must delete and insert data into an Oracle database. Is it possible to use LINQ to SQL with Oracle?
For development I use MS SQL server but it will be a Oracle database in production. What do you recommend?
Officially No. Linq to SQL was originally build with the ability to swap out the data provider to allow connections to other databases, but they disabled this functionality in the released versions to encourage people to use more stable and supported data access layers (like EF). The recommended approach is to use Entity Framework if you want to switch between SQL and Oracle.
Also, Patrick is very right, make sure you are developing and testing against the same database platform you are going to use in production, there is a world of difference in how they operate. Sure, you should be able to abstract it away to not care about whether you are using SQL or Oracle, but that is almost never really the case.
No, you can't. Although LINQ to SQL was initialy designed with multi-database support in mind (you can see this when looking at the code using .NET Reflector) using a provider model, this model was never made public and Microsoft has no intensions in adding multi-database support to LINQ to SQL.
If you need multi-database support, please use Entity Framework.
No, LINQ-to-SQL doesn't support Oracle. Internally, the project had support for multiple back-ends, but this never made it into the final public release. I believe LINQ-to-Entities supports other databases.
the question is basically in the title. Also if anyone has started some kind of implementation but never finished it and is willing to share it, I'm interested! :)
Or if it is being used internally in an open-source project...
I found this while looking for something similar.
Quoting the other post:
Incase anyone is interested.
I'm building a Linq provider for XML columns in sql server.
The Linq provider will translate the query into sql server compatible XQuery code.
Info
Code
This allows you to use sql server like a schema free document DB a'la NoSQL.
Altough the usecase here is not scale but rather the joy of persisting unmapped entities and versioned entities.
I can connect with the DataContext to the Oracle database however I get errors in running the query against the oracle database. I looked at the SQL generated and it is for MSSQL and not Oracle PSQL.
Does anybody know of a decent easy to use wrapper to use LINQ against an Oracle Database?
No, LINQ to SQL is very much MS SQL only - think of it as a client driver.
Microsoft is/was helping Oracle and DataDirect develop providers for Oracle and other non-MS database servers.
We use the OraDirect driver from Devart. It includes ADO.NET Entity framework support. You can download a trial version here. You may then use LINQ to entities or entity SQL on top of this.
The pricing of this is quite developer friendly, you pay per developer seat and you may use it however you like.
Another big advantage of this driver is that you can use it without installing an Oracle client, this is a big plus and worth the price alone.
#Greg: We evaluated the datadirect drivers as well, but the performance was poor and cost astronomical.
Edit: It seems DevArt announced a beta with LINQ support recently
One thing you might look into is that there is now LINQ to Entities, which leverages the MS Entity Framework, which I believe is DB agnostic. I'm still looking into how it works myself, but if you could create an ADO.NET Data Entity that interfaces with Oracle, you could then use LINQ against that Entity.
There's also Lightspeed which has a per-organization (not per-developer) license scheme and seems to have a pretty solid documentation library and a free trial version (up to 8 entities). I'm checking this out presently.
After a long search I found DbLinq and should do the trick. I am going to try it myself. I came across your question because I was searching for the same solution. Hope it helps.
Do look at Linq to entities though. I have a datareader populate a collection of objects that are mapped to the oracle table. I can use linq to query that collection in very powerful, simple, and easy ways. I love it. Highly recommend.
Try Devart LinqConnect. This product allows you to work with Oracle, etc.
Why not try ALinq ? http://www.alinq.org
Look in codeplex:
Linq To Oracle project
Not an easy way, at least until a good provider is produced.
Really MS should provide at least an OLEDB Linq provider. After all, Linq to Sql is basically an implementation of IQueryable with designer support.
Another cross-database solution that works fairly well across Oracle, SQLite, MySQL and SQL Server is eXpress Persistent Objects