Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
SqueakDBX - Transaction support
Last updated at 10:12 pm UTC on 16 March 2009
This is an SqueakDBX feature which intention is to help the user to handle transactional concept transparently among the different supported RDBMS. Basically there are 3 important messages in DBXConnection class:

startTransaction

All it does is to send a query to the database telling to start a transaction. So, if you then do a rollback or commit, it will be commited or rollback till the point where you start the transaction. Starting a transaction may vary from one engine to another. The DBXConnection delegate the query (the query associated to starting a transaction) on the DBXPlatform. On this class there is a common implementation on this method which executes 'START TRANSACTION'. If that query is not the correct for a particular backend, for example for oracle, the associated platform for that backend must override that query. In this case, DBXOraclePlatform would override startTransaction method and would do an 'SET TRANSACTION READ WRITE'.
In many backends, there are more options in the "start transaction" query. For example, in oracle, you would like to do 'SET TRANSACTION READ ONLY'. So, in case you must use something different from what it is in the platform you have some alternatives:

commit

I just do a commit

rollback

I just do a rollback

Example

    conn startTransaction.

    
result := conn execute: 'delete from alumno'.

    
conn commit.


Unit Tests

For more examples, information and usage, you can see the tests we have related with this. These tests are: DBXTransactionalManageTest