Spring batch: [SQLITE_BUSY] The database file is locked (database is locked)

0

I'm doing a Batch that reads SQLite data and transforms it into CSV But every time I run the program it shows the same exception  "[SQLITE_BUSY] The database file is locked (database is locked)" The method that reads the data:

   @Bean
   ItemReader<Model> reader(DataSource dataSource) {

       JdbcCursorItemReader<Model> model = new  JdbcCursorItemReader<Model>();
       model.setDataSource(dataSource);
       model.setRowMapper(new BeanPropertyRowMapper<Model>(Model.class));
       model.setSql("SELECT * FROM Puntuaciones");
        return model;

    }

connection method:

       @Bean
   public DataSource dataSource() {
     String url = "jdbc:sqlite:sqlite.db";
     DriverManagerDataSource dataSource = new DriverManagerDataSource();         
     dataSource.setUrl(url);
     dataSource.setUsername("root");
     dataSource.setPassword("");

     return dataSource;
   }
    
asked by Naghost 17.04.2018 в 20:44
source

0 answers