Subject | Re: [ib-support] Re: generator of generators |
---|---|
Author | Woody (TMW) |
Post date | 2003-03-03T22:53:21Z |
>I don't know too many Italians but it couldn't hurt my vocabulary to learn a
> >That means that we should not always take things so literally but
> >should try to understand the thought behind the words
>
> exactly that.
>
> I can teach you a lot a bad words in Italian that you can practice
> with me :)
few choice words. :)
>Not a problem. I have used a separate table structure for things like this
> Sorry for any inconvenience and thank you for your help.
by creating a type of psuedo-locking algorithm so that only one user can
access the information at a time. Since IB/FB doesn't do row level locking,
it takes a little bit of work but it can be done. For example, a table with
a structure like this:
CompanyID Integer
NextID Integer
Locked Char
You can then build a procedure in code that first checks the Locked field
for the company you are looking at. If the Locked field is 'N', then you try
to change it to 'Y' and post the change. If the change gets posted, you can
get the NextID for that company and increment it. Then post that change, set
Locked to 'N' and release the transaction. Anyone who needs to get the
NextID for that company will not be able to until you release the
transaction since it will error for them when they try to change the Locked
field. It's not exactly high-tech, but it works in some situations like
this.
Of course, the one drawback is that you have to build an administrator
function that can clear the locks in case someone crashes after posting the
Locked field. <g>
Woody (TMW)
"Never trust a computer you can't throw out a window."
-Steve Wozniak