title: Store data temporarily before saving into database
body: <p>I am developing an application using Yii framework where I need to store data temporarily before saving into database.</p>
  
  <p>The screen is divided into  master and detail. </p>
  
  <p>The detail part is shown using CGridview. </p>
  
  <p>I want to store the data in CGridview tempoarily and when the save button is clicked it will be stored into database. The temporary data should be editable and can be deleted. </p>
  
  <p>I thought of storing it in session, but then how can I generate new primary key ID for the rows? </p>
  
  <p>Also emptying the table and then inserting all the values in CGridview  into table is not possible, because I am linking those IDs to a history table of the same data.</p>
  
  <p>How can I do this? </p>
  
  <p>Please help.</p>