Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>More detail would be great and some examples but I think I should be able to help with what you have written here. </p> <p>Have one static SessionFactory (this is big on memory) Also with your transactions you want something like this.</p> <pre><code>SomeClass object = new SomeClass(); Session session = sessionFactory().openSession() // create the session object session.beginTransaction(); //begins the transaction session.save(object); // saves the object But REMEMBER it isn't saved till session.commit() session.getTransaction().commit(); // actually persisting the object session.close(); //closes the transaction </code></pre> <p>This is how I used my transaction, I am not sure if I do as many transaction as you have at a time. But the session object is light weight compared to the SessionFactory in memory. </p> <p>If you want to save more objects at a time you could do it in one transaction for example.</p> <pre><code>SomeClass object1 = new SomeClass(); SomeClass object2 = new SomeClass(); SomeClass object2 = new SomeClass(); session.beginTransaction(); session.save(object1); session.save(object2); session.save(object3); session.getTransaction().commit(); // when commit is called it will save all 3 objects session.close(); </code></pre> <p>Hope this help in some way or points you in the right direction. I think you could configure you program to condense transactions as well. :)</p> <p><em>Edit</em> Here is a great youtube tutorial. This guy really broke it down for me.</p> <p><a href="http://www.youtube.com/playlist?list=PL4AFF701184976B25" rel="nofollow">Hibernate Tutorials</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload