title: Hibernate_sequence error in Spring Boot Batch (scheduled)
body: <p>I have interesting situation. I have parsed several news posting websites and want to save them to database through scheduler. But the error occures while saving. Because of transactional write-behind condition <a href="https://stackoverflow.com/questions/27697810/hibernate-disabled-insert-batching-when-using-an-identity-identifier-generator">described here</a>.</p>
  
  <p>My model class is </p>
  
  <pre><code>@Entity
  @Table(name="News")
  public class News {
  
      @Id
      @GeneratedValue(strategy = javax.persistence.GenerationType.TABLE)
      private Long id;
  
      @Column(name="title")
      private String title;
  
      @Column(name="entity")
      private String entity;
  
      @Column(name="text")
      private String newsText;
  
      @Column(name="url")
      private String url;
  
      @Column(name="newsDate")
      private Date newsDate;
      //getters and setters}
  </code></pre>
  
  <p>my hibernate settings (Spring boot ones)</p>
  
  <pre><code>    spring.jpa.show-sql=true
  spring.jpa.hibernate.ddl-auto=none
  create-drop
  spring.database.driverClassName=org.postgresql.Driver
  spring.datasource.url=jdbc:postgresql://localhost:5432/projectAn
  spring.datasource.username=postgres
  spring.datasource.password=Iskandar123
  </code></pre>
  
  <p>My spring Batch scheduled method </p>
  
  <pre><code>   @Scheduled(initialDelay=5000,fixedRate=5000)
      private void mferNews()
      {
          Document doc;
          try
          {
               doc = Jsoup.connect("http://www.mfer.uz/ru/news/news-uzb/").get();
  
              Elements links = doc.select("a[href^=/ru/news/news-uzb/");
  
              for(Element link : links) {
                  //System.out.println("");
                 if(isMatch(link.attr("href")))
                 {
                  News news = new News();
                  //System.out.println("http://www.mfer.uz" + link.attr("href"));
                  String url = "http://www.mfer.uz" + link.attr("href");
                  doc = Jsoup.connect("http://www.mfer.uz" + link.attr("href")).get();
  
                  if(!doc.title().toString().equals("МВЭСИТ - Новости Узбекистана"))
                  {
                      news.setUrl(url);
                      news.setTitle(doc.title());
                      news.setEntity("МВЭСИТ");
                      news.setNewsText("");
                      //news.setNewsDate(new Date());
                  //System.out.println("Title: " + doc.title());
                  Elements paragraphs = doc.select("div.detail-text").first().select("div ");
                  int i = 0;
                      for(Element p :paragraphs)
                      {
                          i += 1;
                          if(i != 1)
                          {
                              news.setNewsText(news.getNewsText() +"&lt;br /&gt;\n" + p.text());
                              //System.out.println(p.text());
                          }
                      }
                      parsingService.addNews(news);
                  }
  
                 }
  
              }
          }
          catch(IOException e)
          {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>my ERROR LOGS</p>
  
  <pre><code>    2016-08-03 22:22:53.147  WARN 4620 --- [pool-2-thread-1] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 42P01
  2016-08-03 22:22:53.147 ERROR 4620 --- [pool-2-thread-1] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: relation "hibernate_sequences" does not exist
    Позиция: 36
  2016-08-03 22:22:53.162 ERROR 4620 --- [pool-2-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task.
  
  org.springframework.dao.InvalidDataAccessResourceUsageException: error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: error performing isolated work
      at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:242) ~[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:225) ~[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:436) ~[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:131) ~[spring-data-jpa-1.9.4.RELEASE.jar:na]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      at com.sun.proxy.$Proxy75.save(Unknown Source) ~[na:na]
  </code></pre>
  
  <p>I am stack in that problem almost last 2 days.</p>
  
  <p>i am stack in this problem almost 2 days. i suppose that the problem is around @GeneratedValue and the strategy. </p>