# River schedule does not work properly with h2 database

**URL:** <https://discuss.elastic.co/t/river-schedule-does-not-work-properly-with-h2-database/21423>\
**Category:** Elasticsearch\
**Created:** [December 29, 2014, 12:46pm UTC](https://discuss.elastic.co/t/river-schedule-does-not-work-properly-with-h2-database/21423 "2014-12-29T12:46:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashish\_Bhargava](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@Ashish\_Bhargava](https://discuss.elastic.co/u/Ashish_Bhargava)\
**Post date:** [December 29, 2014, 12:46pm UTC](https://discuss.elastic.co/t/river-schedule-does-not-work-properly-with-h2-database/21423/1 "2014-12-29T12:46:42Z")

</div>

Hi,

When i try to schedule my Elastic engine db update with river schedule by making a my primary key as \_id  
it works fine with it, it updates the same \_id everytime and does not add duplicate records.

i m using river like this :-

{  
"type": "jdbc",  
"jdbc": {  
"driver": "org.postgresql.Driver",  
"url": "jdbc:postgresql://localhost:5433/NGP\_DB",  
"user": "jdbcusr",  
"password": "password",  
"index": "constituent",  
"type": "user",  
"sql": "select id AS \_id, dtype as dt from ngp.constituent",  
"schedule" : "0 0-59 0-23 ? \* \*"  
}  
}

But when i try with h2 with same combination , the river keeps on duplicating data in place of updating the same data, river is like this

{  
"type": "jdbc",  
"jdbc": {  
"driver": "org.h2.Driver",  
"url": "jdbc:h2:tcp://localhost:9092/cx-h2-admissions",  
"user": "jxadmin",  
"password": "jxadmin",  
"index": "constituent",  
"type": "user",  
"sql": "select id as \_id, fullname , lastname , firstname , middlename , city , st, zip , ctry , ss\_no , phone , mail , phone\_ext as areaCode from schema.id\_rec",  
"schedule" : "0 0-59 0-23 ? \* \*"  
}  
}  
can anybody help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:41am UTC](https://discuss.elastic.co/t/river-schedule-does-not-work-properly-with-h2-database/21423/2 "2017-07-06T00:41:36Z")

</div>

Closed on July 6, 2017, 12:41am UTC


