My database (SQL Server) contains a table structure that mimics a spreadsheet.
The parent table is a worksheet.
The child table is a row.
The grandchild table is a cell.
I have defined POJO objects to represent each table; the worksheet object contains a set of row objects, each row object contains a set of cell objects.
When my program saves a large worksheet object (e.g. > 1,000 rows), all other users are locked out of the application until the save completes (takes about 15-20 seconds per 1,000 row objects and the more cell objects, the longer it takes).
Rather than saving the worksheet object, would it be better to iterate over the row objects and commit after a number of row object saves? MAybe I should commit after saving each row object?
Is there another/better way to save this object structure?
Thanks in advance,
Steven.
|