简体   繁体   English

可扩展的MS Access ASP.NET应用

[英]Scaleable MS Access ASP.NET app

I am constrained by the following, no way around it: 我受以下限制,没有办法解决:

  1. Read-Only Data: Microsoft Access 只读数据:Microsoft Access
  2. JET 4.0 OLDB JET 4.0 OLDB
  3. ASP.NET 2.0 ASP.NET 2.0
  4. Shared Host, very little control. 共享主机,几乎没有控制权。
  5. OR Mapper - LLBL Gen Pro 或Mapper-LLBL Gen Pro

The app is a read-only tool that reads a lot of Microsoft Access Databases in the APP_Data folder. 该应用程序是一种只读工具,可读取APP_Data文件夹中的许多Microsoft Access数据库。 Works fine mostly. 大部分都能正常工作。

Under load it starts failing accessing the Access MDBs. 在负载下,它开始无法访问Access MDB。

What is the best strategy for accessing the Access MDBs to limit errors in accessing them? 访问Access MDB以限制访问错误的最佳策略是什么? Right now I try, then Thread.Sleep(500) on an error then try again. 现在我尝试,然后在出现错误时执行Thread.Sleep(500),然后重试。

I think there may be ways to modify the isolation/concurrency/locking options when accessing the Access databases to eliminate overhead of managing locks. 我认为在访问Access数据库时,可能有一些方法可以修改隔离/并发/锁定选项,以消除管理锁的开销。 Perhaps try "Mode=Share Deny None;" 也许尝试 “ Mode = Share Deny None;”。 in the connection string. 在连接字符串中。 I would not use this if you are modifying data in any way at anytime though as it's pretty much throwing out all the isolation/concurrency management that you get with a database. 如果您随时随地以任何方式修改数据,我将不会使用它,因为它几乎会丢弃您通过数据库获得的所有隔离/并发管理。 Use at your own risk. 使用风险自负。

How frequently does the data change? 数据多久更改一次? If it's read-only can you load the data from the databases into cache and read it from there instead of directly from the databases? 如果它是只读的,您可以将数据库中的数据加载到缓存中并从那里读取而不是直接从数据库中读取吗?

What kind of specific errors getting. 什么样的特定错误得到。 I assume they are connection errors? 我认为它们是连接错误?

This is a horrible solution but if you truly are "lost on a desert island with only these tools" and the access databases are completely read-only, then create multiple copies of each of them and allow only a certain number of connection into any of them at a time. 这是一个可怕的解决方案,但是如果您确实“仅凭这些工具迷失在荒岛上”并且访问数据库完全是只读的,那么请为每个数据库创建多个副本,并仅允许一定数量的连接进入任何一个他们一次。 For example, if you have 2 access databases, MdbAA and MdbBB then create copies like: 例如,如果您有2个访问数据库,则MdbAA和MdbBB然后创建如下副本:

  • MdbAA01 MdbAA01
  • MdbAA02 MdbAA02
  • MdbAA03 MdbAA03
  • MdbBB01 MdbBB01
  • MdbBB02 MdbBB02
  • MdbBB03 MdbBB03

Then when a request comes for MdbAA, see how many requests are currently accessing MdbAA01, if over the threshold, then try MdbAA02, etc. Do the same for any requests to the MdbBB file. 然后,当请求MdbAA时,请查看当前有多少个请求正在访问MdbAA01,如果超过阈值,则尝试MdbAA02,等等。对MdbBB文件的任何请求都执行相同的操作。

Like I said this is very bad solution but if you truly have no choice then it might work for you. 就像我说的那样,这是非常糟糕的解决方案,但是如果您真的别无选择,那么它可能对您有用。 But realistically it sounds like the app has outgrown Access (and the shared host) so it is time to upgrade the architecture. 但实际上,听起来应用程序的访问权限(和共享主机)已不足够了,因此该升级架构了。

Spend a bit of money and get some sql storage. 花一点钱,并获得一些SQL存储。 How much time have you spent working on fitting a crutch to a broken sounding system? 您花了多少时间将拐杖安装到损坏的发声系统上?

If the project is worth doing then it's worth investing some cold hard cash. 如果该项目值得做,那么就值得投资一些冷钱。

If a business is trying to force you down this route, explain why the option you have is not viable. 如果企业试图迫使您选择这条路线,请解释为什么您拥有的选择不可行。 If you suggested the option in the first place, grow a pair and explain why you were wrong, but this is how you can fix it. 如果首先建议使用该选项,则增加一对并说明为什么输入错误,但这是解决问题的方法。

Sorry if that comes off as flippant. 对不起,如果那变成轻浮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM