# Anyone Encounter Flushing Issues with CSVWriter?

**URL:** <https://forum.liquibase.org/t/anyone-encounter-flushing-issues-with-csvwriter/129>\
**Category:** General Discussion\
**Created:** [July 14, 2009, 5:18am UTC](https://forum.liquibase.org/t/anyone-encounter-flushing-issues-with-csvwriter/129 "2009-07-14T05:18:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![r351574nc3](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@r351574nc3](https://forum.liquibase.org/u/r351574nc3)\
**Post date:** [July 14, 2009, 5:18am UTC](https://forum.liquibase.org/t/anyone-encounter-flushing-issues-with-csvwriter/129/1 "2009-07-14T05:18:00Z")

</div>

Just starting to enable a database I’m using for liquibase. Just having trouble with versioning the data. I decided to just export it as CSV using CSVWriter. That way \<loadData …/\> can be used to load it in through a changelog. This is only to be used for v000 of the database. Sounds like a good plan to me. One little problem though. The last record of each table is always truncated ☹ Doesn’t seem to be related to how many fields are in the table. It could a table with only one field and still be truncated. Looks to me like the output buffer is just not getting flushed since the amount of varies but is always within the size of the buffer.

Anyone know of a way around this? For now, I will just omit the records, but I’d really like that last record for each table that is missing.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [July 14, 2009, 5:18am UTC](https://forum.liquibase.org/t/anyone-encounter-flushing-issues-with-csvwriter/129/2 "2009-07-14T05:18:00Z")

</div>

What version of liquibase are you running?

Nathan

---

<div class="post-metadata">

**Author:** ![r351574nc3](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@r351574nc3](https://forum.liquibase.org/u/r351574nc3)\
**Post date:** [July 14, 2009, 5:18am UTC](https://forum.liquibase.org/t/anyone-encounter-flushing-issues-with-csvwriter/129/3 "2009-07-14T05:18:00Z")

</div>

I am using 1.9.3

I did find a workarouund. I am using writer.flush() after writing each record set. Perhaps maybe it is my local autoflush settings. Is there a way to turn autoflushing on in Java?

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [July 14, 2009, 5:18am UTC](https://forum.liquibase.org/t/anyone-encounter-flushing-issues-with-csvwriter/129/4 "2009-07-14T05:18:00Z")

</div>

You can usually pass an autoflush attribute into the constructor of your Writer class.&nbsp; Otherwise you do need to call flush() before closing.

Nathan
