title: Multivalue Mysql Inserts using HibernateTemplate
body: <p>I am using Spring HibernateTemplate and need to insert hundreds of records into a mysql database every second.</p>
  
  <p>Not sure what is the most performant way of doing it, but I am trying to see how the multi value mysql inserts do using hibernate.</p>
  
  <pre><code>String query = "insert into user(age, name, birth_date) values(24, 'Joe', '2010-05-19 14:33:14'), (25, 'Joe1', '2010-05-19 14:33:14')"
  
  getHibernateTemplate().execute(new HibernateCallback(){
   public Object doInHibernate(Session session) throws HibernateException, SQLException {
        return session.createSQLQuery(query).executeUpdate();
   }
  });
  </code></pre>
  
  <p>But I get this error:
  'could not execute native bulk manipulation query.' Please check your query .....</p>
  
  <p>Any idea of I can use a multi value mysql insert using Hibernate? or is my query incorrect?</p>
  
  <p>Any other ways that I can improve the performance? I did try the saveOrUpdateAll() method, and that wasn't good enough!</p>