简体   繁体   中英

SQL Server CE with .NET mutliple applications

I am new to .NET development and SQL Server CE, I am working on some database issues in our company product.

The way it is designed is there are 2 apps ( .csproj ) to which SQL Server CE is dynamically linked ( .DLL ), we have a wrapper which uses the DLL to create, update, delete the database, and they access one SQL Server CE database ( .sdf )

After reading online a bit on SQL Server CE with .NET apps I found out:

  1. Multiple apps can access the same .sdf file, no extra need to have own locking mechanism in place to access the database

  2. the database is small and the .NET app loads the database in the memory and operations are performed in the memory itself.

Now my questions are:

  1. As there are 2 .NET apps which access this .sdf database, are there 2 copies of same .sdf file in the memory and the apps are modifying their own version?

  2. What am I doing wrong, team sees issue (exception content already deleted), database access is slow.

Thank you

1: If the apps share the same file, they modify the same file, not their own version. Notice that SQL CE has a (max 10 second default) flush to disk delay.

2: Do not throw exception if a delete has already happened! (You might be affected by the 10 second buffer delay - this can be set to lower, but can impact performance slightly)

Slow database access: Might be completely unrelated - do you have the needed indexes etc - ie: show us some code, please

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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