summaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2008-02-21 04:19:03 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2008-02-21 04:19:03 +0000
commit14dfafc20d30463a3f248aaa628567bc9db421c6 (patch)
treef5878fe5544411c668b358b831d97fbeb074a86b /src/java
parent5e082624a41a7042ac7aa7a805ff93e4b7201e27 (diff)
downloadjackcess-14dfafc20d30463a3f248aaa628567bc9db421c6.tar.gz
jackcess-14dfafc20d30463a3f248aaa628567bc9db421c6.zip
update rowCount in common method
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@228 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java')
-rw-r--r--src/java/com/healthmarketscience/jackcess/Table.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Table.java b/src/java/com/healthmarketscience/jackcess/Table.java
index cfc7fcf..3e3cbbe 100644
--- a/src/java/com/healthmarketscience/jackcess/Table.java
+++ b/src/java/com/healthmarketscience/jackcess/Table.java
@@ -314,8 +314,7 @@ public class Table
}
// make sure table def gets updated
- --_rowCount;
- updateTableDefinition();
+ updateTableDefinition(-1);
}
/**
@@ -1107,20 +1106,20 @@ public class Table
writeDataPage(dataPage, pageNumber);
//Update tdef page
- _rowCount += rows.size();
- updateTableDefinition();
+ updateTableDefinition(rows.size());
}
/**
* Updates the table definition after rows are modified.
*/
- private void updateTableDefinition() throws IOException
+ private void updateTableDefinition(int rowCountInc) throws IOException
{
// load table definition
ByteBuffer tdefPage = getPageChannel().createPageBuffer();
getPageChannel().readPage(tdefPage, _tableDefPageNumber);
// make sure rowcount and autonumber are up-to-date
+ _rowCount += rowCountInc;
tdefPage.putInt(getFormat().OFFSET_NUM_ROWS, _rowCount);
tdefPage.putInt(getFormat().OFFSET_NEXT_AUTO_NUMBER, _lastAutoNumber);