Result false from save

Posts   
 
    
tvoss avatar
tvoss
User
Posts: 192
Joined: 07-Dec-2003
# Posted on: 18-Feb-2004 12:23:28   

Is it true that the result false being returned from entity save is only going to occur when the number of records updated is zero?

So is it further true that false will be returned only if concurrency as implemented with overloaded save is violated or if the record is deleted while I am editing it, or I try to save a record that doesn't exist?

Are those the only cases where a false will return?

Thanks,

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39873
Joined: 17-Aug-2003
# Posted on: 18-Feb-2004 14:29:27   

tvoss wrote:

Is it true that the result false being returned from entity save is only going to occur when the number of records updated is zero?

Correct. This means that the row you want to update with the PK of the entity you want to save AND with fields matching the concurrency clause you specified is not found. This can be that the row is deleted, the PK values are somehow changed (I hope for you this is not the case wink ) or that the concurrency clause was violated, for example a timestamp field is changed.

It can ALSO be that the sqlserver's connection parameters of the server instance (enterprise manager -> select server -> properties -> connections tab) has 'no rowcount' checked. This means amount of rows affected reports are always -1.

So is it further true that false will be returned only if concurrency as implemented with overloaded save is violated or if the record is deleted while I am editing it, or I try to save a record that doesn't exist? Are those the only cases where a false will return?

Yes simple_smile

True is returned when there is nothing changed, when the fields collection is empty (not happening normally) or when the save was succesful.

Frans Bouma | Lead developer LLBLGen Pro