Posts

Showing posts from December, 2012

HSQLDB: how to commit after update on disk

HSQLDB does not save the update into disk immediately. According to HyperSQL database documentation, The WRITE DELAY controls the frequency of file sync for the log file. When WRITE_DELAY is set to FALSE or 0, the sync takes place immediately at each COMMIT. WRITE DELAY TRUE performs the sync once every 0.5 seconds (which is the default). A numeric value can be specified instead. I have this sample Java code as my Unit Test case class which I actually made it using Spring Framework, package org.mystuff.com.repository; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests; import org.springframework.transaction.annotation.Transactional; import org.junit.Befo...