On Friday 28 December 2001 12:03 pm, Stefan Karlsson wrote:
> Tip: If you want to have very simple MK/MySQL support of transactions
> you can do like this (at least it works for me :-).
>
> 1) Subclass MySQLObjectStore and override saveChanges:
>
> class MyMySQLObjectStore(MySQLObjectStore):
>     def saveChanges(self):
>         self.executeSQL('BEGIN')
>         try:
>             MySQLObjectStore.saveChanges(self)
>         except Exception, e:
>             self.executeSQL('ROLLBACK')
>             raise e
>         else:
>             self.executeSQL('COMMIT')

Should this also be a setting?

        'SQLSaveChanges': ['BEGIN', 'ROLLBACK', 'COMMIT'],

Or are these always the same? So then:

        'SQLCommitOrRollBack': 1,

(Most of my experience is with MySQL so I'm less familar with other 
db's.)


> 3) Edit GeneratedSQL/Create.sql and add TYPE=InnoDB after every
> create table:
>
> create table MyClass (
>     myClassId                        int not null primary key
> auto_increment, ) TYPE=InnoDB;
>
>
> The last step must be repeated every time you generate your SQL files
> from the object model :-(
> But if we ask Chuck kindly he might fix this in the MK generate stuff
> :-). It would be perfect if one could set an option in
> Settings.config, like 'MySQLTableType':'InnoDB'.


I agree that a setting is the way to go. Is there a notion of "table 
type" in any other flavor of SQL? Perhaps the setting should just be 
"SQLTableType".


-Chuck

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to