> > >> Well, got it most of the way done and hitting an obnoxious bug or issue > that I can't pinpoint exactly where it's coming from. Four of the queries > - two in the ConnectionMapper.xml file and two in the > ConnectionGroupMapper.xml file - are causing some problems. One example is > below. Something about the queries where it tries to execute multiple > SELECT statements along with the <foreach> loops - it almost looks like > it's not resetting the start position of the array index in each of the > foreach loops, so when it goes to do the second loop it hits an > ArrayIndexOutOfBoundsException because it's trying to access a parameter > index beyond what's been delivered to it. It's really, really odd that it > works perfectly fine in PostgreSQL, SQL Server, and MySQL, but fails in > SQLite. It seems like it should be an issue with MyBatis or MyBatis-Guice, > but the fact that it's only happening in SQLite points to something in the > JDBC driver. > > Someone else was, apparently, trying to do this and also ran across the > issue. > > -Nick >
This looks to be a bug (or feature, perhaps) in the way the SQLite JDBC driver handles parameters in prepared statements. I tracked it most of the way down (minus a solution), and filed a GitHub issue on the SQLite JDBC driver page [1]. I also responded to the StackOverflow question that was posted back in January [2]. I'll probably go ahead and submit the PR for the SQLite module with the changes necessary to overcome the buggy (IMHO) behavior in the driver and see if anything becomes of the issue I filed. Won't be real clean, but it'll work. -Nick [1] https://github.com/xerial/sqlite-jdbc/issues/277 [2] https://stackoverflow.com/questions/41969037/sqlite-mybatis-guice-throw-arrayindexoutofboundsexception
