Git Product home page Git Product logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024
Paul, SQLiteStatement instances are cached by default in SQLiteConnection and 
not disposed unless removed from cache. So the memory is consumed not only by 
every single SQLiteStatement but also by cache entries.

If you'd like SQLiteStatement not be cached, you can set "cached" to false when 
using method 
http://almworks.com/sqlite4java/javadoc/com/almworks/sqlite4java/SQLiteConnectio
n.html#prepare(java.lang.String, boolean)

Please note that your example of "prepare, step, dispose" - without any bind or 
column calls is equal to calling exec.

Also, please note that putting values as literals into SQL is generally a 
no-no, so I guess you either have very good reasons to use such an SQL, or you 
need to rewrite this part with bind variables (which then would reduce the 
number of prepared statements to the number of tables in your DB, and caching 
would make sense).

Cheers
Igor

Original comment by [email protected] on 31 Jul 2011 at 7:56

  • Changed state: WontFix
  • Added labels: Type-Other
  • Removed labels: Type-Defect

from sqlite4java.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024
Ah thank you, didn't know what I was supposed to do with the SQLiteStatements. 
I'm now using a single statement and rebinding it for every insert. It handles 
very similar to using exec, i.e. negligible memory usage. Haven't noticed 
significant performance increase, but hey, at least I'm using it correctly :-) 

Original comment by [email protected] on 2 Aug 2011 at 2:12

  • Added labels: ****
  • Removed labels: ****

from sqlite4java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.