Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25893
| Date | 2011-02-07 18:04 -0500 |
|---|---|
| From | Arne Vajhøj <arne@vajhoej.dk> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: The easiest framework for Java Database applications development released for production use |
| References | <740c95bd-a21f-4ad3-8733-6b3b61e44e18@l18g2000yqm.googlegroups.com> <MPG.27b8fec562e57f9e9897c8@news.justthe.net> <iinp9v$765$1@news.albasani.net> <92e64642-b624-4598-beaa-c57540a30733@k22g2000yqh.googlegroups.com> <iioobf$h14$1@news.albasani.net> |
| Message-ID | <4d507a88$0$23752$14726298@news.sunsite.dk> (permalink) |
| Organization | SunSITE.dk - Supporting Open source |
On 07-02-2011 07:25, Lew wrote: > yaormaAdmin wrote: >> Thanks for the feedback. The special bit in the code shown on the >> front page is in the Database.getData(sqlString, conn) call. >> Basically it encapsulates the boilerplate code that opens the cursor >> on the database side (e.g by creating a Statement and a ResultSet). >> Often in large projects someone, somewhere, inevitably forgets to > > Fire that person. There's nothing "inevitable" about such a rookie mistake. That can be a bit late. >> close the Statement and/or the Resultset in a finally block where an > > <http://download.oracle.com/javase/6/docs/api/java/sql/Statement.html#close()> > > "Note: When a Statement object is closed, its current ResultSet object, > if one exists, is also closed." It does not cost much to call close instead of hoping the JDBC driver implementator read the specs and the API docs. >> exception is thrown. This results in a cursor being left open in the >> database. Eventually the code is executed enough times to exhaust the >> maximum number of cursors allowed for the connection. The next call >> that opens a cursor in the database fails. This is often not the >> offending code but some perfectly good code that exists in some other >> far off place in the code. > > How "often" does that happen? What statistical basis do you have for > such a claim? Where is your evidence? ResultSet's are probably very rare. Connection's happen. >> Since yaorma encapsulates all of this boilerplate code (i.e. the >> allocation and deallocation of the Statement and Resultset objects and >> the opening and closing of the database cursors) this type of error is >> prevented. Also, its easier to get the data in the single >> Database.getData(sqlString, conn) call than to write the boilerplate > > And what if you aren't ready to deallocate the Statement? The philosophy in this type of library is not to cover everything, but to cover 90-95% of the cases. Those with more advanced requirements will have to look elsewhere. >> The pages in the more details link (http://www.yaormama.orĝ/pages/ >> details.html) at the bottom of the homepage go into some of this stuff >> as well as some of the other functionality including parametrized >> queries, the generation and use of data value objects, marshaling data >> from web pages, and marshaling data from the database in constant >> space (e.g. for large data sets) etc. > > How well does this sliced-bread thingie work with JPA? Given that it is not an ORM, then ..... Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Re: The easiest framework for Java Database applications development released for production use Lew <noone@lewscanon.com> - 2011-02-06 22:35 -0500
Re: The easiest framework for Java Database applications development released for production use Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 18:04 -0500
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-07 18:59 -0800
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-07 19:18 -0800
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-06 20:30 -0800
Re: The easiest framework for Java Database applications development released for production use Steve Sobol <sjsobol@JustThe.net> - 2011-02-06 21:54 -0800
Re: The easiest framework for Java Database applications development released for production use Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 18:00 -0500
Re: The easiest framework for Java Database applications development released for production use Lew <noone@lewscanon.com> - 2011-02-07 07:25 -0500
csiph-web