| 775 | |
| 776 | # Store the Crash object into the crashes table. |
| 777 | def __add_crash(self, crash): |
| 778 | session = self._session |
| 779 | r_crash = None |
| 780 | try: |
| 781 | # Fill out a new row for the crashes table. |
| 782 | r_crash = CrashDTO(crash) |
| 783 | session.add(r_crash) |
| 784 | |
| 785 | # Flush and get the new row ID. |
| 786 | session.flush() |
| 787 | crash_id = r_crash.id |
| 788 | |
| 789 | finally: |
| 790 | try: |
| 791 | # Make the ORM forget the CrashDTO object. |
| 792 | if r_crash is not None: |
| 793 | session.expire(r_crash) |
| 794 | |
| 795 | finally: |
| 796 | # Delete the last reference to the CrashDTO |
| 797 | # object, so the Python garbage collector claims it. |
| 798 | del r_crash |
| 799 | |
| 800 | # Return the row ID. |
| 801 | return crash_id |
| 802 | |
| 803 | # Store the memory dump into the memory table. |
| 804 | def __add_memory(self, crash_id, memoryMap): |