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:
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:
- Change the code in your image
- Extends the platform, override
- Do startTransaction, commit and rollback, manually (using DBXConnection #execute: aString).
I just do a commit
I just do a rollback
result := conn execute: 'delete from alumno'.
For more examples, information and usage, you can see the tests we have related with this. These tests are: DBXTransactionalManageTest