title: Is there a way to force Zend_Session_SaveHandler_DbTable to write to the database earlier?
body: <p>I have the following table that handles reserverations:</p>
  
  <pre><code>CREATE TABLE `Plots` (
    `Plot_ID` int(11) NOT NULL AUTO_INCREMENT,
    `Grid_ID` int(11) NOT NULL DEFAULT 0,
    `Instance_ID` int(11) NOT NULL DEFAULT 0,
    `Session_ID` char(32) DEFAULT NULL,
    `User_ID` int(11) DEFAULT NULL,
    `Transaction_ID` int(11) DEFAULT NULL,
    `CreateDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    `UpdateDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    `Plot` varchar(10) NOT NULL DEFAULT 0,
    `ReserveDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    `ReservationTimeoutDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    `PurchaseDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    PRIMARY KEY (`Plot_ID`),
    CONSTRAINT `Plots_ibfk_1` FOREIGN KEY (`Grid_ID`) REFERENCES `Grids` (`Grid_ID`) ON DELETE NO ACTION ON UPDATE CASCADE,
    CONSTRAINT `Plots_ibfk_2` FOREIGN KEY (`Instance_ID`) REFERENCES `Instances` (`Instance_ID`) ON DELETE NO ACTION ON UPDATE CASCADE,
    CONSTRAINT `Plots_ibfk_3` FOREIGN KEY (`Session_ID`) REFERENCES `Sessions` (`Session_ID`) ON DELETE SET NULL ON UPDATE CASCADE,
    CONSTRAINT `Plots_ibfk_4` FOREIGN KEY (`User_ID`) REFERENCES `Users` (`User_ID`) ON DELETE NO ACTION ON UPDATE CASCADE,
    CONSTRAINT `Plots_ibfk_5` FOREIGN KEY (`Transaction_ID`) REFERENCES `Transactions` (`Transaction_ID`) ON DELETE NO ACTION ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
  </code></pre>
  
  <p>As you can see, "Session_ID" is a foreign key to my Sessions table, which is being managed by Zend_Session and Zend_Session_SaveHandler_DbTable.</p>
  
  <p>I'm having problems when I create the session, and within the same script, try to use it's Session_ID to insert a record into "Plots" (shown above), because the record does not exist in the Sessions table.</p>
  
  <p>Can I force Zend_Session_SaveHandler_DbTable to save it's data into the database earlier? If so, how?</p>