Open GoogleCodeExporter opened 8 years ago
You need to close the resultset for the file to be released.
Original comment by noelgrandin
on 20 Oct 2014 at 6:38
Please reopen this issue; this wasn't my code that was executing, it was the H2
web browser console that I executed the command in. The bug is somewhere in H2,
either the web console or the server that performs the csvread.
Original comment by localde...@gmail.com
on 20 Oct 2014 at 5:58
I see, you are using "create table ... as select ... from csvread" or "insert
into ... select ... from csvread", right?
Looking at the code, it does look like the file is not closed when an exception
occurs, but I currently don't see how to best solve this. As a workaround, I
guess it's enough to call System.gc() a few times, but of course that's not
really a solution.
Original comment by thomas.t...@gmail.com
on 20 Oct 2014 at 6:24
Issue 589 has been merged into this issue.
Original comment by thomas.t...@gmail.com
on 20 Oct 2014 at 6:26
Thanks for looking into this. Yes, I am using the "create table as select from
csvread" syntax. I haven't seen the source, but is it not possible to close the
file in the exception handler or the finally clause etc? I have none of my own
code executing at that point, I can't call "system.gc()" since it's not my java
process, it's the H2 java process.
Can you point me to the package / classname / line number if you still know
roughly those details? Maybe I can write a small patch or something. We deal
with a ton of generated csv files, not all of them are "clean" and so this
problem is going to continue for us.
Original comment by localde...@gmail.com
on 21 Oct 2014 at 2:11
Thomas, any updates on this? Can you point me in the general direction in terms
of where I can find the issue in the source code?
Original comment by localde...@gmail.com
on 29 Oct 2014 at 3:12
A minimal test case would be great. I think the problem can occur if there is a
problem reading the data, but also if there is a problem reading the header.
The problem is that "csvread" will open a ValueResultSet, which is then used to
insert the data. That object is not closed. I'm also not sure on how to best
solve this.
Original comment by thomas.t...@gmail.com
on 15 Jan 2015 at 7:03
Original issue reported on code.google.com by
localde...@gmail.com
on 15 Oct 2014 at 6:37