StrataFrame Forum

Access 2007 & Concurrency

http://forum.strataframe.net/Topic15302.aspx

By Crones - 4/1/2008

I need help trying to figure out why the StrataFrame concurrency exception is not thrown when using a Microsoft Access 2007 database.

I've checked and double checked my settings... When I apply the same thing to an SQL Server everything works fine... Any ideas?



Attached is a sample project with the settings I am using.
By Crones - 4/2/2008

Bump Hehe
By Edhy Rijo - 4/2/2008

Hi Crones,

I willing to test your sample project, please post steps to do the same test you are doing.

By Crones - 4/2/2008

The steps to reproduce what SHOULD cause an concurrency exception is to start the project, and after the form loads and displays the values, open the database with Access and change the values of the table and save the changes. Then click the save button on the app.



When I do the same steps using SQLExpress, I get the concurrency exception which is what I need to happen.



Thanks for checking it out.
By Edhy Rijo - 4/2/2008

Ok, I am able to duplicate your results.  Have you tried with OptimisticTimeStamp or OptimisticRowVersion?

My guess is that somehow Access is either not sending the event or SF is not catching it.

By Trent L. Taylor - 4/3/2008

The only way that the concurrency will work with Access is by using a row version field.  The Optimistic all fields and timestamp options will not work with Access.  If you create a row version field and then set the CRUD settings on the BO, it will work.  I updated and posted the sample that you had started.  When you create the version field, be sure to have all records update with a 0 for teh default value or it will not work.  The reason is when you add the new version field it will basically be empty...so it will get overlooked.
By Edhy Rijo - 4/3/2008

Trent L. Taylor (04/03/2008)
The only way that the concurrency will work with Access is by using a row version field.  The Optimistic all fields and timestamp options will not work with Access.  If you create a row version field and then set the CRUD settings on the BO, it will work.  I updated and posted the sample that you had started.  When you create the version field, be sure to have all records update with a 0 for teh default value or it will not work.  The reason is when you add the new version field it will basically be empty...so it will get overlooked.

Hi Trent,

One question, will the Version field be incremented automatically by SF or do we have to update this field in every change of the record to trigger the concurrency rule?

Also what would be the reccomended concurrency rule for MS-SQL2005?

By Trent L. Taylor - 4/3/2008

One question, will the Version field be incremented automatically by SF or do we have to update this field in every change of the record to trigger the concurrency rule?

It will be auto-managed just as the SQL Server and others do.

Also what would be the reccomended concurrency rule for MS-SQL2005?

Regardless of the database, row versioning is always the best method as the query is far less complicated than when using all fields.  This is actually a section that we cover during training and show the massive differences between using row versioning and any other type of checking.

By Edhy Rijo - 4/3/2008

Regardless of the database, row versioning is always the best method as the query is far less complicated than when using all fields.  This is actually a section that we cover during training and show the massive differences between using row versioning and any other type of checking.

Trent,

Thanks for the info.  I am sure I'll have a lot fun in the training with all the material to cover.  So far with the help of SF I am doing pretty good with this project and I am sure many things will have to be re-written after the training BigGrin, but for now, just trying to keep things put Tongue and getting ready for the training.

By Crones - 4/3/2008

Thanks for the help Trent & Edhy Rijo. Much appreciated.
By Trent L. Taylor - 4/3/2008

So far with the help of SF I am doing pretty good with this project and I am sure many things will have to be re-written after the training , but for now, just trying to keep things put and getting ready for the training.

Well, I can already tell you that you will end up on top of things and be successful with your application.  You have an open mind and are willing to learn and adopt new things and techniques.  This is how you get on the top of the pile!

We live in a continuously changing business and we too are always learning better and more efficient ways to do things...so we refactor our code very often as well.

By Trent L. Taylor - 4/3/2008

Thanks for the help Trent & Edhy Rijo. Much appreciated.

No problem Smile