Re: problem with transactions

From: Barry Lind <blind(at)xythos(dot)com>
To: pginfo <pginfo(at)t1(dot)unisoftbg(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: problem with transactions
Date: 2004-05-10 16:43:53
Message-ID: 409FB149.4060705@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

It is a setting in the postgresql.conf file. I believe Oliver in his
response to your original question mentioned the specific parameter.

--Barry

pginfo wrote:
> Barry Lind wrote:
>
>> I would suggest that you turn on sql statement logging on your
>> database server and see exactly what the jdbc driver is sending to the
>> server. I suspect this information will help you track down the problem.
>>
>> thanks,
>> --Barry
>>
>>
>> pginfo wrote:
>>
>>> Hi,
>>>
>>> We are using pg 7.4.2 + jdbc to connect to jboss.
>>>
>>> It looks that pg have problems with transactions and jdbc.
>>>
>>> My example:
>>>
>>> Connection con = ... I get connection to my db.
>>>
>>> con.setAutoCommit(false); // begin transaction
>>>
>>> // do some inserts
>>>
>>> con.rollback(); // rollback
>>>
>>> After this code all is working very well.
>>> All inserts are rollbacked and so on.
>>>
>>> And now the second example:
>>>
>>> Connection con = ... I get connection to my db.
>>>
>>> con.setAutoCommit(false); // begin transaction
>>>
>>> // do some inserts
>>>
>>> con.rollback(); // rollback
>>> con.setAutoCommit(true); // set autocommit. We are using
>>> connection pool and will to have clear connection.
>>>
>>> For my supprice the last example do not rollback any inserts !
>>> I do not see nothink bad in this code, and also it is working perfect
>>> on oracle + jdbc and also MSSQL + jdbc.
>>>
>>> Pls., can some one check the situation and post the result.
>>>
>>> I tryed to insert sole sllep for 5 sec. before the last
>>> con.setAutoCommit(true); , but it do not help.
>>>
>>> Is it bug into the jdbc or pg ?
>>>
>>> I tested it also with pg 7.4.1 and 7.4. and I have the same problem.
>>>
>>> regards,
>>> ivan.
>>>
>>>
>>> ---------------------------(end of broadcast)---------------------------
>>> TIP 8: explain analyze is your friend
>>
>>
>>
>>
>>
>>
> How to do it?
> Will I need to recompile pg or I can set it up into conf-file?
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2004-05-10 16:49:21 Re: problem with transactions
Previous Message pginfo 2004-05-10 16:33:36 Re: problem with transactions