| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: "Transactions are bad, real bad" - discuss
Paul, I'm willing to give you a pass to almost all what you claim,
although you have to provide more substance, so I'll give you a pass "in
principle it can be done, the results are unclear". Do you have a
published paper somewhere ?
But to my pertinent and very general example, you haven't responded instead raised a different example, which by the way can be resolved trivially, even with the current DB2 and transaction.
>>Here's a deal: I reserve a sum to be debited against a client account >>(the sum is not debited yet, just the available balance reflects the >>reservation - i.e. the client has committed to pay). Based on some other >>happenings in the client software (let's say I cannot performa the >>service, or I can, etc), I want either to go ahead with the debit, or >>cancel the transaction (ROLLBACK). Compose several of these happening >> >>BEGIN >>db->DB_STATEMENT1 >>client->ACTION1 >>db->DB_STATEMENT2 >>client->ACTION2 >>db->STATEMENT3 >>END >> >>Where each consecutive action depends on some results of the previous >>action, and at each point in time client should be able to decide a >>rollback.
It is not seductive but very efficient in terms of development cost and in terms of factoring out functionality that in your model will have to be shifted to be a burden for your users.
What about the mere commit statements ? Not only rollback, but just commit, how do you make the client computation part of the single database statement ?
As for your example, that's a trivial problem to solve:
>
> db->DB_STATEMENT0 INSERT INTO 3G_Auction_Bid ('Network2', $11Billion')
> BEGIN TXN
> db->DB_STATEMENT1 INSERT INTO 3G_Auction_Bid ('Network2', $12Billion')
> client->ACTION1 Wait for 2 mins // end of the auction //
> db->DB_STATEMENT2 SELECT winning_bid FROM 3G_Auction_Result
> client->ACTION2 If winning_bid > $11Billion THEN
> db->DB_STATEMENT3 COMMIT ELSE ROLLBACK END
> END TXN
>
> Would you allow that in your DBMS? If not how to avoid it? Vet all
> applications using your DBMS! What an overhead.
>
First fo all, the code above is incorrect with regards to probable business rules. To protect against bad developers, I doubt there is any model in the world that could do that. The second the insert if itb gets the lock, will prevent anybody else from submitting bids, and so on, so forth
Second you can make the client automatically rollback if he violates business rules, by using triggers, you can design a special column to get the timestamp of the transaction, create special rules to autocommit for particular transactions, and so on so forth.
>>>My short answer is, if the 'client programmer' want to freeze time then >>>tough - that is not allowed in this model of reality. >>> >> >>Tough luck indeed. So we are back to using better models of reality. >>Like transactions.
Yes, so most of the time these compensating transactions can be taken automatically by the database, while also taking care of concurrency and isolation issues. That's why we have so much theory on the subject.
Now you want me to write code to do all these ? Forget about it.
When I need a special case, I'll commit my transactions sooner rather than later, or even have the autocommit turned on, and I shall write code for special cases.
>>Well, another reality check for you: not all participants in distributed >>systems are databases. Even if some are databases not all need to >>support relational algebra.
This is trivially true in your theory, in reality it is trivially false. And for good reasons :)
> Would my transactionless model make such masquerading more difficult for
> existing systems? Pass. Is it more difficult to add transactions to a
> non-transactional system, or to hide all evidence of transactions from a
> transactional system? Pass (although I suspect the latter).
>
> If you have a 'distributed system' that is not trying to be a distributed
> relational database, then you can use whatever logical model you so desire,
> including say a logical concept of transactions.
>
Yes, but I'll not be able to integrate that system wityh your transactionless database. You know transaction theory is not confined to the universe of databases. They are an essential ingredient in the construction of many distributed algorithms.
>
>>Therefore you cannot say >> >> BIG_VALUE_OFTHE_WHOLE WORLD := NEW_VALUE_OF_THE_WHOLE_WORLD
>>Imagine the scenario above with DB and client, compounded by several >>participating resource managers.
Those mreley implementation issues, should lead you down the path that some implementation issues in design of advanced programming languages proved to be provably unsolvable.
>>I perform an update, I get some results back, do a computation >>in the client, depending on my results, I'll issue some more updates, or >>I want to issue a rollback.
Both of them plus the computation on my side have to be atomic.
>>> >>>This is no different from today. Well it is different as many existing
>>>systems do not respect the rule that transaction timestamp order needs to >>>agrees with transaction serialization order. Banning transactions makes >>>keeping to this rule much easier to implement. >> >>Yes. You just shifted the burden to the client programmer.
I thibnk you seriously need to contemplate and quantify what this "extra work" means in a systematic way.
I hope it was a typo error when you implied we should not delegate things like choosing the locking protocol. As inflexible as that is in the DBMSes of today, it is correct and it works.
Delegate that to the user and then you'll see troubles.
>>No, you made a claim, you have to provide at least as good mechanism as >>transactions do.
Well, if you do provide that mechanism all is left to do is present that to us. What you presented so far is extremely unconvincing and rather flawed in my opinion.
Best,
Costin Cozianu
Received on Wed Apr 30 2003 - 16:18:03 CDT
![]() |
![]() |