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.
Related
Can we integrate Hibernate and SAP? I do have integrated a few databases with Hibernate. Since am not aware of SAP, I want to know if there is any support provided by Hibernate to integrate it with the SAP.
As far as I know I don't think that exists. SAP has its own data mapping strategy known as Open SQL and also provides special functions to insert, update and delete data that also ensure data consistency, those functions are called BAPI and unless you have an SAP connector to call these BAPIs then there's not much you can do. For more reference check this .Net connector example.
Sure you can make a connection directly (if the system administrator and/or DBA let you) to the database however is not advisable and is very dangerous because you could create inconsistencies in the system. Please do not try this approach.
However you can make use of software like the connectors I mentioned before or you could use the SAP interface system. You can find more information on this issue checking out the terms ALE and IDocs.
Another strategy is using an intermediate table on a database where you and SAP take and write data and with some controls communicate each other but on this issue you would use a BAPI in case of using a standard table or making a custom table (Z table) where you have more freedom to make your own changes.
Hope it helps
No, because SAP is not a database.
SAP is a software which is backed by a database. It does support several different RDBMS systems. Theoretically you could use Hibernate to access the database which backs your SAP system, but this is likely not a very good idea. Both hibernate and SAP are built on the assumption that they have exclusive access to the database. Having another application make changes to the DB without them knowing can lead to all kinds of obscure problems.
There are, however, several other methods to integrate SAP into your business processes, like calling BAPI function models using SAPs proprietary RFC protocol, communicating via IDocs, Batch-Input, SOAP webservices and many more.
If you think of the SAP system as a database as in RDBMS: No, you can't, because it isn't - as others have pointed out.
If you want to use something Hibernate-like stuff to access a backend system, you might want to take a look at Hibersap.
You can say SAP has built its own "Hibernate framework" in the Application Layer called OpenSQL( I guess this was built ages before Hibernate ). So SAP applications(ERP/CRM/SRM etc.) can communicate with any database type. So think of it like, SAP has a dialect for different databases.
But when you configure SAP application to use a Database, that database is locked down by SAP and you should not even try to hack it to directly update the database using direct SQL or any other framework like Hibernate. SAP does 100s of validations and checks before it saves the data into the database, you would be bypassing these checks if you are updating the database directly.
I think no organisation would allow you to do it in a production environment and if they allow you to, they don't need SAP.
SAP owns some database products like maxDB, sybase, HANA etc..Hibernate has the dialects for these products. Hibernate with HANA could be interesting.
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
Are there any known issues of EF usage with Oracle database? Are there any key points I should specially pay attention? Share your toughts and experience please?
Devart dotConnect for Oracle allows you a direct access to the Oracle database without Oracle client installation.
You will need to use a 3rd party EF provider to talk to Oracle, this may cost money.
All of the EF examples asume you are using Sql Server
Most EF implementations for Oracle require the deployment of the Oracle client in order to use some or all of the available features. Look for an implementation that is 100% managed for support of all features in order to avoid the performance bottlenecks, memory leaks, and deployment headaches this type of implementation can cause.
We have a client that has Oracle Standard, and a project that would be ten times easier addressed using OLAP. However, Oracle only supports OLAP in the Enterprise version.
Migration to enterprise is not possible
I'm thinking of doing some manual simulation of OLAP, creating relational tables to simulate the technology.
Do you know of some other way I could do this? Maybe an open-source tool for OLAP? Any ideas?
You can simulate OLAP functionality using client side tools pointed at a relational database.
Personally I think the best tool for the job is probably Tableau Desktop. This is an amazingly sophisticated front end analytics tool that will make your relational data look multidimensional without much effort, and the tool itself is really mind blowing. They have a free trial so you can take it for a spin. We use Tableau heavily for our own analysis and have been very impressed. Of course, this tool also works with multidimensional databases as well, so if you end up with some cubes at the end of the day you can continue to use the Tableau front end.
As for open source, you could try out Palo - an open source MOLAP server and Excel front end.
If you are interesting in building your own reporting front end and use .NET there are a number of components (such as the DevExpress PivotGrid or the several tools from RadarSoft) that will do the same thing, but will require some elbow grease to get wired together.
I find that it's the schema that causes most of the issues people have with querying a database. OLAP forces you to either a flat table or a Star/snowflake schema which is easy to query and comparably faster to the source oltp tables. So if you ETL your source to a flat table or star schema you should get 80% of what you get from OLAP, the 20% being MDX and analytic functions and performance.
Note that you should get a perf boost with a star schema in relational database as well and Oracle probably has analytic functions in PL/SQL anyways.
Try an open-source OLAP server called 'Mondrian'. IIRC the XMLA API on this is sufficiently compatible with AS to fool Pivot Table Services, which would allow you to use it with ProClarity or Excel.
IIRC it was originally designed to work over Oracle - it is a HOLAP architecture using base tables in the underlying relational store and caching aggregates. You can also make use of materialised views and query rewrite in the underlying Oracle database to do aggregates.
A few more thoughts on this topic:
Actually, Oracle Standard does have an OLAP facility based on a descendent of Express embedded in the database engine and storing its internal data structures in BLOBs in the main tablespaces. Using this is technically possible but not necessarily advisable for the following reasons:
It uses a highly non-standard OLAP query engine with very little third party tool support (AFAIK ArcPlan is the only third-party OLAP front-end supporting 10g+ OLAP), poor documentation for the query language and almost no third party literature describing it. This will work with B.I. Beans if you feel like writing a JSP front-end. It is not compatible with MDX at all. As of early 2006 the best Oracle could do when asked about drillthrough (this functionality was not supported in Discoverer 'Drake') was to recommend building a JSP apllication using B.I. Beans.
The reason that there is no migration path from Standard to Enterprise is that Enterprise is actually what used to be Siebel Analytics. Standard is the old Oracle OLAP/Express descendant which Oracle partners recommended avoiding even before Oracle bought out Seibel. Oracle has not even attempted to support migrating.
From this point of view, Mondrian is actually the most cost-effective OLAP solution for an Oracle Standard Edition shop. You can get a supported version from an outfit called Pentaho1. The next cheapest is Analysis Services, which comes with SQL Server. Following that you are into the likes of Hyperion Essbase, which will be an order of magnitude more expensive than SQL Server or any supported verion of Mondrian.
Whilst MS SQL Server offers OLAP, you'll need an Enterprise licence to use a cube in a live environment that is web-facing.
You might want as well to give a try to www.icCube.com - we're quite flexible on the data-source used to populate the cube and are quite cost effective compared to the big actors of the market.
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