LINQToEntities 与 Sybase ASE 15.5
在过去的几天里,我一直在尝试使用实体框架和 LINQ 2 实体,它们与 SQL Server 完美配合(正如我所期望的),但问题是我必须使用 Sybase ASE 15.5。
我说“问题”是因为以下原因:
- 生成/更新模型通常需要太长时间
- 有时它会生成一个错误,指出该字段 <字段名>已经在元数据集合中(我认为它与具有关系的表中相同的命名约束或字段名称有关(FK 是最常见的)
- 我做了一个简单的模型,其中生成 / 不会有问题更新,但问题是有时(取决于查询)LINQ To Entities 生成的 T-SQL 会在 ASE 中引发一些错误
我使用的是 Sybase SDK 版本 15.5.0.1000,ADO.NET 提供程序是否来自这个 SDK 工作得很好(比如,我做错了什么吗)?如果没有,是否有更新的东西我必须安装来解决这些问题(比如更新的 SDK,一些 dll 或一些方言)翻译)?(我知道有一个新的 Sybase ASE -15.7-,但它是否带有新的 SDK?而且可能并不重要,因为我不确定 IT 总监和 CIO 是否会批准更改。现在)
我也尝试了 Data Direct 提供程序,但在尝试生成模型时遇到了困难,根据我在其网站上读到的内容,BLToolkit 也依赖于供应商数据提供程序(至少对于非 Microsoft DB)。我真的很喜欢与 Entity Framework 一起使用的东西,但此时只需与 ASE 和 ASE CE 一起使用的东西就可以了(还没有尝试 NHibernate 主要是因为乍一看它似乎涉及太多的手动工作,并阅读ASE 出现一些问题)
提前感谢您提供的任何帮助。
For the past days I've been trying to use Entity Framework and LINQ 2 Entities, which work perfectly fine with SQL Server (as I would expect) but the problem is that I have to use Sybase ASE 15.5.
I say "the problem" because of the following:
- It usually takes too long to generate / update the model
- Sometimes it generates an error saying that the field < fieldname > is already in the metadata collection (I think it has something to do with named constraints or field names that are the same in tables with a relation (FKs being the most common)
- I made a simple model in which there would be no problems generating / updating, but the issue is that sometimes (depending on the query) the T-SQL generated by LINQ To Entities throws some error in ASE
I am using the Sybase SDK version 15.5.0.1000, Does the ADO.NET Provider from this SDK work well (as in, am I doing something wrong)?, if not, is there a newer one? are there any other stuff I have to install to solve these issues (like a newer SDK, some dll or some dialect for the translation)? (I'm aware there's a new Sybase ASE -15.7- but does it come with a new SDK? and probably doesn't matter much since I'm not sure the IT Director and CIO would approve for a change right now)
I've also tried the Data Direct provider but it gets stuck while trying to generate the model, BLToolkit is too, from what I read at their site, dependant on the vendor data provider (at least for non-Microsoft DBs). I would really like something that works with Entity Framework, but just something that works with ASE and ASE CE will do at this point (haven't tried NHibernate just yet mostly because at first glance it seems to involve too much manual work, and read somewhere it had some problems with ASE)
Thanks in advance for any help that you can provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于已经过去一周了,还没有发表评论,所以我自己来回答这个问题。
看起来 SDK 确实有问题,显然模型生成创建了一个巨大的 T-SQL 执行,因此延迟很大。它确实存在一些名称类似的约束问题,但仅在 ASE 中存在,在 ASE CE 中似乎没有任何问题。我找不到任何资源,比如特定于 ASE 的方言,所以我猜他们的驱动程序还没有准备好与实体框架一起使用,因为生成的 T-SQL 是针对 SQL Server 的,在某些查询中会引发 ASE 异常。
我可能会选择 NHibernate,因为它似乎是最有益的一条路径(如,它实际上有效)并且它是免费的。另外,似乎 Progress (DataDirect) 人员在试用期间确实为他们的 ADO.NET 提供商提供支持,我会打电话给他们,看看问题是否可以轻松解决,在这种情况下,我可能最终会使用它。
更新:显然这个问题已经得到解决,因为现在我可以使用 Sybase 驱动程序创建模型了。
Since it's been a whole week and not even a comment was made, I'm gonna answer this myself.
It seems that the SDK has indeed problems, apparently the model generation creates a monster of T-SQL that gets executed, thus the big delay. It indeed has some problems with constraints that are named similarly but only in ASE, in ASE CE it doesn't appear to have any. I could not find any resource like a dialect specific for ASE so I guess their driver is not ready to use with Entity Framework, because the T-SQL generated is for SQL Server which in some queries will throw an exception with ASE.
I'm probaly gonna go with NHibernate since it seems to be the one path that will be the most beneficial (as in, it actually works) and it's free. Also, seems like the Progress (DataDirect) people do offer support during trial period for their ADO.NET provider, I will call them up and see if the issues can be solved easily, in which case, I'll probably end up using it.
UPDATE: Apparently this has been fixed since now I can create a model with the Sybase driver.