sqlTask>>postInitalization"During postInitalization we need to get the mapping data for the mapper object"self spMappings: (XyzMapper withTable: self tableName onSession: self session).SqlTask>>disconnect"do session close and disconnects, handle any errors locally"* Note handle of errorSignal since we might be here handling the take down of a process because of a previous error. Also our session could be hosed and we don't care this late in the gameObject errorSignalhandle:[:ex |ex return]do:[self session isNil ifFalse: [self session disconnect].self connection isNil ifFalse: [self connection disconnect]
| Previous slide | Next slide | Back to first slide | View graphic version |
Notes:
Post initialization code just moved logic into another location where I had a clean connection. In this example, I used a complete creation method to create a mapper object. It of course uses the SQL session we just created to complete its SQL processing
Disconnect logic required trapping of fatal errors since anything could happen, and we wanted to avoid recursive exception handling loops.
This ends the logic for initialize, processing, and shutdown. Simple. It applies across all tasks.