Speeding up hibernate startup time using terracotta?

I’m in the middle of creating a conversion utility from one database to another, and I have to reinitialize my Hibernate configuration quite often. When you have a couple of hundred entities that need configuring, starting up Hibernate can take a long time. My initial thought was to serialize the SessionFactory and deserialize it upon each startup.

I didn’t try this yet, but something tells me this won’t work. Call it a nagging feeling. However, it should be possible to run the SessionFactory in a Terracotta cluster and keep that server alive, and connect my conversion utility on startup with the Terracotta cluster. This should make startup times a snap.

Mind you: this is just a thought experiment. If someone has done this before, leave a note!

3 thoughts on “Speeding up hibernate startup time using terracotta?

  1. From the issue, they didn’t try keeping it running in a separate JVM using terracotta. I am convinced that using terracotta *will* speed up startup time considerably, provided that it works of course.

  2. Martijn, you can serialize the object Configuration and from there, create an instance of SessionFactory.

    Search within Hibernate’s documentation website.

    Regards,
    Bruno

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>