Re: WARNING: ROLLBACK: no transaction in progress

Поиск
Список
Период
Сортировка
От Bjørn T Johansen
Тема Re: WARNING: ROLLBACK: no transaction in progress
Дата
Msg-id 1055075169.16559.34.camel@pennywise.havleik.no
обсуждение исходный текст
Ответ на Re: WARNING: ROLLBACK: no transaction in progress  (Barry Lind <blind@xythos.com>)
Ответы Re: WARNING: ROLLBACK: no transaction in progress  (Dmitry Tkach <dmitry@openratings.com>)
Список pgsql-jdbc
Hmmm, I am using the connection pooling in Tomcat to get database
connection, don't know if that would make a difference....


BTJ

On Thu, 2003-06-05 at 02:55, Barry Lind wrote:
> Bjørn,
>
> I can't reproduce your problem.  I used the attached program that I
> wrote from the information you provided below and it doesn't have any
> such warning in the log files.
>
> thanks,
> --Barry
>
>
> Bjørn T Johansen wrote:
> > I am using the new version 7.3.3 where I also compiled the jdbc driver..
> >
> > The code I use looks something like this..:
> >
> >     Connection conn = DBPool.getInstance().getConnection();
> >     PreparedStatement stmt = null;
> >     Statement stmt2 = null;
> >
> >     try
> >     {
> >       conn.setAutoCommit(false);
> >
> >       String sql= "Insert into table () Values (?)";
> >       stmt = conn.prepareStatement(sql);
> >       int ant = stmt.executeUpdate();
> >       stmt.close();
> >       stmt = null;
> >       conn.commit();
> >       conn.close();
> >       conn = null;
> >     }
> >     catch (SQLException ex)
> >     {
> >       conn.rollback();
> >       conn.close();
> >       throw new Exception;
> >     }
> >
> >
> >
> > Hope this helps...
> >
> > BTJ
> >
> >
> > On Wed, 2003-05-28 at 11:53, Dave Cramer wrote:
> >
> >>What version of the driver are you using, this sounds like a bug
> >>
> >>Can you send some code to re-create it?
> >>
> >>Dave
> >>On Tue, 2003-05-27 at 06:33, Bjorn T Johansen wrote:
> >>
> >>>Why do I get this in my logfile, when I never call rollback, only
> >>>commit? Should I just ignore this or??
> >>>
> >>>
> >>>Regards,
> >>>
> >>>BTJ
> >>>
> >>>
> >>>-----------------------------------------------------------------------------------------------
> >>>Bjørn T Johansen (BSc,MNIF)
> >>>Executive Manager
> >>>btj@havleik.no                  Havleik Consulting
> >>>Phone: +47 67 54 15 17         Conradisvei 4
> >>>Fax: +47 67 54 13 91           N-1338 Sandvika
> >>>Cellular: +47 926 93 298       http://www.havleik.no
> >>>-----------------------------------------------------------------------------------------------
> >>>"The stickers on the side of the box said "Supported Platforms: Windows
> >>>98, Windows NT 4.0,
> >>>Windows 2000 or better", so clearly Linux was a supported platform."
> >>>-----------------------------------------------------------------------------------------------
> >>>
> >>>
> >>>---------------------------(end of broadcast)---------------------------
> >>>TIP 2: you can get off all lists at once with the unregister command
> >>>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> >>>
>
> ______________________________________________________________________
>
> import java.sql.*;
>
> public final class test25 {
>     private static String DB_URL  = "jdbc:postgresql://localhost:5432/test";
>     private static String DB_USER = "test";
>     private static String DB_PASS = "test";
>
>     public static void main(String[] args) throws Exception {
>         // load driver
>         Class.forName("org.postgresql.Driver");
>         // open connection to postgres
>         Connection conn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASS);
>         PreparedStatement stmt = null;
>
>         try
>         {
>             conn.setAutoCommit(false);
>             //This test assumes a table 'test' exists with one column 'cola' of type text
>             String sql= "Insert into test (cola) values (?)";
>             stmt = conn.prepareStatement(sql);
>             stmt.setString(1,"foo");
>             int ant = stmt.executeUpdate();
>             stmt.close();
>             stmt = null;
>             conn.commit();
>             conn.close();
>             conn = null;
>         }
>         catch (SQLException ex)
>         {
>             conn.rollback();
>             conn.close();
>             throw ex;
>         }
>     }
> }
--
-----------------------------------------------------------------------------------------------
Bjørn T Johansen (BSc,MNIF)
Executive Manager
btj@havleik.no                  Havleik Consulting
Phone : +47 67 54 15 17         Conradisvei 4
Fax : +47 67 54 13 91           N-1338 Sandvika
Cellular : +47 926 93 298       http://www.havleik.no
-----------------------------------------------------------------------------------------------
"The stickers on the side of the box said "Supported Platforms: Windows
98, Windows NT 4.0,
Windows 2000 or better", so clearly Linux was a supported platform."
-----------------------------------------------------------------------------------------------


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: Official JDBC driver release ?
Следующее
От: Bjørn T Johansen
Дата:
Сообщение: Re: WARNING: ROLLBACK: no transaction in progress