the database should handle this, and make sure that
 any _new_ record gets an new number only it it was inserted successfully
===========
Well, this approach looks very attractive (me even use in a small PG
based project). The main flaw is it can only be done via blocking
wrong operations by DB facilities then informing user about that
blocking by an exception which generally has a numeric code & some
message both depending on used DB backend (PG, SQLite3 etc). This
exception must be caught & parsed so that to display users a message
they can understand. Also a problem is possible changing of
transaction state - more work of tracing & handling etc.
Martin, what is Your opinion about way of managing DB constraints ? By
GUI at time of editing, or by DB facilities+exception handling ?



2012/1/21, Sieghard <s_c_...@arcor.de>:
> Hallo IvankoB,
>
> Du schriebst am Fri, 20 Jan 2012 11:03:13 +0500:
>
>> Create them yourself? (Programmatically, that is - in the simplest case,
>>  use an autoincrement field.)
>> ==============
>> This approach means intercepting & parsing DB exception reason -
>> doable but cumbersome & depends on API changes, locales etc
>> In my case, a text field is checked on uniqueness.
>
> What? Sorry, I don't understand that. I've never used such a construct
> either, as I didn't have a use for it. But it seemed appropriate for your
> purpose to me. I thought it wouldn't need any "intercepting & parsing DB
> exception" to use it - the database should handle this, and make sure that
> any _new_ record gets an new number only it it was inserted successfully.
> As this is an SQL function, no "API changes" should be in the way, and for
> mere counting, even "locales etc" shouldn't matter.
> But anyway, it was just a random idea, if it doesn't fit your needs, then
> just forget about it.
>
> --
> (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
> nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
> -----------------------------------------------------------
> Mit freundlichen Grüßen, S. Schicktanz
> -----------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> mseide-msegui-talk mailing list
> mseide-msegui-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to