New To TMSTable

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
swright
Posts: 28
Joined: Wed 23 Dec 2009 12:19

Post by swright » Thu 31 Dec 2009 11:04

There may be a possibility of looking to support both MSSQL and MySQL.

So Does UniDAC offer Identical Functionality to SDAC or is some functionality sacrificed for the cross db functionality.


And

I have Implemented a test editor and have a multi user issue

User 1 Opens Row A to Edit
User 2 Opens Row A to Edit
User 2 Makes changes and commits within a transaction
User 1 Makes a change and commits within a transaction

record now reflects User 1 Changes without any warning of the conflict.

I am used to a conflict exception on post being raised.

How is this resolved?

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 04 Jan 2010 08:41

swright wrote:the 10 records was just an example.
originally I was looking at all records, as a ttable replacement.
It appears that if the result set is too large then it is processed differently.
If you don't use the TOP clause, then SQL Server returns result with delay because of sorting, and we can't influence this.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 04 Jan 2010 08:45

swright wrote:There may be a possibility of looking to support both MSSQL and MySQL.
So Does UniDAC offer Identical Functionality to SDAC or is some functionality sacrificed for the cross db functionality.
UniDAC supports different access providers, like SQL Server, Oracle, MySQL, and InterBase. However, SDAC has access to more server-specific features of MS SQL Server. Therefore, if you use only MS SQL databases, SDAC will be the best solution for you.
If you get SDAC, you will have access to more server-specific features of MS SQL Server. You can learn more about SDAC features here:
http://devart.com/sdac/features.html,
and about UniDAC features here:
http://devart.com/unidac/features.html.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 04 Jan 2010 08:50

swright wrote:I have Implemented a test editor and have a multi user issue

User 1 Opens Row A to Edit
User 2 Opens Row A to Edit
User 2 Makes changes and commits within a transaction
User 1 Makes a change and commits within a transaction

record now reflects User 1 Changes without any warning of the conflict.
I am used to a conflict exception on post being raised.
How is this resolved?
To solve the problem use the TCustomDADataSet.LockMode property. You can find more detailed information about this property in the SDAC help.

swright
Posts: 28
Joined: Wed 23 Dec 2009 12:19

Post by swright » Tue 05 Jan 2010 12:53

Thanks for the help.

using Optimistic lock i get an EDatabaseError 'Record was changed by another user'

Is there an error number as it is possible the error message text could change in future.

Is there a list of errors eg "duplicate key" etc.


As there may be a possibility of needing to support MySQL in future as well as MS-SQL. If i redevelop using SDAC will it be difficult to make the source work with both SDAC and MyDAC (not at the same time)


regards

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 06 Jan 2010 08:38

swright wrote:using Optimistic lock i get an EDatabaseError 'Record was changed by another user'
Is there an error number as it is possible the error message text could change in future.
Is there a list of errors eg "duplicate key" etc.
This error doen't have an error number. You can use only error message.
swright wrote:As there may be a possibility of needing to support MySQL in future as well as MS-SQL. If i redevelop using SDAC will it be difficult to make the source work with both SDAC and MyDAC (not at the same time)
Yes, you can use MyDAC together with SDAC without any problems. Also you can use UniDAC to support different access providers together, like SQL Server, Oracle, MySQL, and InterBase. You can learn more about UniDAC features here:
http://devart.com/unidac/features.html.

swright
Posts: 28
Joined: Wed 23 Dec 2009 12:19

Post by swright » Fri 08 Jan 2010 12:38

Hello,

I have just got the error

"New transaction is not allowed because there are other threads running in the session".

I see this is because fetchAll is False, However i am only using these datasets for lookup purposes on a form and not updating them and they are set to read only. Is there another way around this or will i have to make it fetch all records for all queries.

Edit: Using another TMSConnection seems to work

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 11 Jan 2010 15:47

Using the FetchAll mode has some limitations. You can find detailed information about it in the "TCustomMSDataSet.FetchAll Property" topic of SDAC help.

Post Reply