From: | Peter T Mount <peter(at)retep(dot)org(dot)uk> |
---|---|
To: | Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> |
Cc: | Brian P Millett <bpm(at)ec-group(dot)com>, postgres <hackers(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc |
Date: | 1999-05-03 11:01:40 |
Message-ID: | Pine.LNX.4.04.9905031157520.2109-100000@maidast.retep.org.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, 2 May 1999, Tatsuo Ishii wrote:
> So far I couldn't find nothing special with the backend by now. Going
> back to the ImageViewer, I think I found possible problem with it. In
> my understanding, every lo call should be in single transaction block.
> But ImageViwer seems does not give any "begin" or "end" SQL commands.
> I made a small modifications(see below patches) to the ImageViewer and
> now it starts to work again with 6.5 backend! I suspect that
> difference of palloc() code between 6.4.2 and 6.5 made the problem
> opened up.
This is true, and is probably why it was opened up.
However, with JDBC, you should never issue begin and end statements, as
this can cause the driver to become confused.
The reason is autoCommit. In jdbc, to start a transaction, you should call
the setAutoCommit() method in Connection to say if you want autocommit
(true), or transactions (false). The standard default is true.
> ---
> Tatsuo Ishii
>
> *** ImageViewer.java~ Mon Oct 12 11:45:45 1998
> --- ImageViewer.java Sun May 2 23:16:27 1999
> ***************
> *** 390,395 ****
> --- 390,396 ----
> {
> try {
> System.out.println("Selecting oid for "+name);
> + stat.executeUpdate("begin");
> ResultSet rs = stat.executeQuery("select imgoid from images where imgname='"+name+"'");
> if(rs!=null) {
> // Even though there should only be one image, we still have to
> ***************
> *** 402,407 ****
> --- 403,409 ----
> }
> }
> rs.close();
> + stat.executeUpdate("end");
> } catch(SQLException ex) {
> label.setText(ex.toString());
> }
>
--
Peter T Mount peter(at)retep(dot)org(dot)uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Contzen | 1999-05-03 12:53:40 | an older problem? hash table out of memory |
Previous Message | Peter T Mount | 1999-05-03 10:57:12 | Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc |