Coder Social home page Coder Social logo

hibernate-examples's Introduction

Hibernate Examples

I prefer H2 to Derby because the Derby devs refused to add 'DROP TABLE ... IF EXISTS' semantics despite many user complaints simply because it is not part of some SQL standard.That, however, clutters tests with useless SQLExceptions when instantiating tables.

In addition to that, H2 also does not create log files (derby.log) by default in random directories like the current working directory.

Second Level Caching And Statistics Gathering

The H2 and HSQL examples include second level caching and use statistics functionality to verify its operation.

Update

H2 supports the command "SHUTDOWN COMPACT". It revealed an annoying leak that prevents BLOBs from getting freed when their data rows get deleted (v1.4.196). It's possible to work around this by re-creating the database (SCRIPT TO/RUNSCRIPT FROM), but H2 also does not support SERIALIZABLE isolation level, so I decided to switch to HSQL.

HSQL also supports "SHUTDOWN COMPACT". It works nicely with BLOBs, but you need to run the "CHECKPOINT" SQL command if those blobs have not been checkpointed yet (ie. merged into the main database file(s)). HSQL also uses more than one file, so it's a good idea to place the main database file as given on the connection string in its own directory.

H2 and HSQL both have a GUI that can be started simply by running their respective database driver jars.

HSQL connection url to use MVCC/serializable isolation:

jdbc:hsqldb:file:dbdir/db;hsqldb.tx=mvcc;hsqldb.tx_level=SERIALIZABLE

-- Build Status devel/java/github/hibernate-examples@7185

-- Build Status devel/java/github/hibernate-examples@7851

hibernate-examples's People

Watchers

jjYBdx4IL avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.