Anyone Encounter Flushing Issues with CSVWriter?

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 :frowning: 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.

What version of liquibase are you running?

Nathan

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?

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

Nathan