| From: | Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com> |
|---|---|
| To: | Thomas Kellerer <spam_eater(at)gmx(dot)net> |
| Cc: | List <pgsql-jdbc(at)postgresql(dot)org> |
| Subject: | Re: Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102 |
| Date: | 2016-01-11 13:05:37 |
| Message-ID: | CAB=Je-Ea77aCTYVQPURxuDV34099ZotXGstC5kXbvhaLq4yYmQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers pgsql-jdbc |
The difference is as follows: 1202 can cache across statement.close()
calls. 1201 can't do that.
In other words, to use server-prepared statements in previous
versions, you had to reuse the *same* PreparedStatement *object* again
and again. As soon as you issue .close() you lose your shiny
server-prepared statement.
Typical applications are written in a form of
PreparedStatement ps = con.prepareStatement(sql);
ps.excuteQuery();
ps.close();
In other words, almost always developers just recreate
PreparedStatement and close it.
The improvement of 1202 was to identify such patterns and use
server-prepared statement in such cases as well.
Vladimir
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2016-01-11 13:09:12 | Re: strange CREATE INDEX tab completion cases |
| Previous Message | rajan | 2016-01-11 13:03:42 | Need help on pgcrypto |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Christian Bjørnbak | 2016-01-11 13:29:00 | Re: Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102 |
| Previous Message | Thomas Kellerer | 2016-01-11 13:00:18 | Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102 |