Hi

I think a trigger is the most database independent solution.

About CHECKSUM TABLE: the MySQL docs say that "the fact that two
tables produce the same checksum does not mean that the tables are
identical."

H2 internally keeps a modification counter for each table, I will make
it available in the next release: New meta data column
INFORMATION_SCHEMA.TABLES.LAST_MODIFICATION to get the table
modification counter. Example:

DROP TABLE IF EXISTS TEST;
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255));
INSERT INTO TEST VALUES(1, 'Hello');
select last_modification from information_schema.tables t where
t.table_name = 'TEST';
INSERT INTO TEST VALUES(2, 'World');
select last_modification from information_schema.tables t where
t.table_name = 'TEST';
SELECT * FROM TEST ORDER BY ID;
select last_modification from information_schema.tables t where
t.table_name = 'TEST';
UPDATE TEST SET NAME='Hi' WHERE ID=1;
select last_modification from information_schema.tables t where
t.table_name = 'TEST';
DELETE FROM TEST WHERE ID=2;
select last_modification from information_schema.tables t where
t.table_name = 'TEST';

Regards,
Thomas

On Tue, Dec 2, 2008 at 10:33 PM, Daniel Pont <[EMAIL PROTECTED]> wrote:
>
> Why not a trigger ?
>
> See http://www.h2database.com/html/features.html#triggers
>
> On 2 déc, 16:58, Lennart Schedin <[EMAIL PROTECTED]> wrote:
>> I have the following problem:
>>
>> I have a large table (typically 20 Mb of data). I have one Java
>> program that needs the data but only for reading. The Java program
>> contains a thread that periodically reads the entire table into main
>> memory (about 1 read per minute).
>>
>> This causes a lot of network traffic (since I have several Java
>> programs).
>>
>> Is there any way to determine if a table has changed since my last
>> read? In Mysql for example there is a CHECKSUM TABLE feature that can
>> be used to only transfer the checksum of the table. That way I can in
>> my Java program determine if I must read the entire table or not.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to