Skip site navigation (1) Skip section navigation (2)

BUG #2708: Saving '\0' to bpchar by jdbc driver 8.1-407.jdbc3

From: "Shutra" <zhoushuqun(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2708: Saving '\0' to bpchar by jdbc driver 8.1-407.jdbc3
Date: 2006-10-20 08:01:10
Message-ID: 200610200801.k9K81AN5065482@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2708
Logged by:          Shutra
Email address:      zhoushuqun(at)gmail(dot)com
PostgreSQL version: 8.1.5-1
Operating system:   Windows or Linux
Description:        Saving '\0' to bpchar by jdbc driver 8.1-407.jdbc3
Details: 

Refer: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2161

    <dependency>
      <groupId>postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>8.1-407.jdbc3</version>
    </dependency>

User user = new User();
user.setGender('M');
Transaction t = HibernateTest.getSessionFactory().getCurrentSession()
.beginTransaction();
HibernateTest.getSessionFactory().getCurrentSession().save(user);
t.commit(); //Saved OK.

user = new User();
user.setGender('\1');
t =
HibernateTest.getSessionFactory().getCurrentSession().beginTransaction();
HibernateTest.getSessionFactory().getCurrentSession().save(user);
t.commit(); // Also saved OK.

user = new User();
user.setGender('\0');
t =
HibernateTest.getSessionFactory().getCurrentSession().beginTransaction();
HibernateTest.getSessionFactory().getCurrentSession().save(user);
t.commit(); // Failed. That means the '\0' is not supported by the jdbc of
postgresql.

2006-10-20 15:44:23,638 DEBUG [org.hibernate.impl.SessionImpl] - opened
session at timestamp: 11613302636
2006-10-20 15:44:23,638 DEBUG [org.hibernate.transaction.JDBCTransaction] -
begin
2006-10-20 15:44:23,638 DEBUG [org.hibernate.jdbc.ConnectionManager] -
opening JDBC connection
2006-10-20 15:44:23,638 DEBUG [org.hibernate.transaction.JDBCTransaction] -
current autocommit status: false
2006-10-20 15:44:23,638 DEBUG
[org.hibernate.event.def.AbstractSaveEventListener] - generated identifier:
2c90c1710e64ad81010e64ad86560003, using strategy:
org.hibernate.id.UUIDHexGenerator
2006-10-20 15:44:23,653 DEBUG [org.hibernate.transaction.JDBCTransaction] -
commit
2006-10-20 15:44:23,653 DEBUG
[org.hibernate.event.def.AbstractFlushingEventListener] - processing
flush-time cascades
2006-10-20 15:44:23,653 DEBUG
[org.hibernate.event.def.AbstractFlushingEventListener] - dirty checking
collections
2006-10-20 15:44:23,653 DEBUG
[org.hibernate.event.def.AbstractFlushingEventListener] - Flushed: 1
insertions, 0 updates, 0 deletions to 1 objects
2006-10-20 15:44:23,653 DEBUG
[org.hibernate.event.def.AbstractFlushingEventListener] - Flushed: 0
(re)creations, 0 updates, 0 removals to 0 collections
2006-10-20 15:44:23,653 DEBUG [org.hibernate.pretty.Printer] - listing
entities:
2006-10-20 15:44:23,653 DEBUG [org.hibernate.pretty.Printer] -
test.hibernate.User{id=2c90c1710e64ad81010e64ad86560003, username=null,
gender=

pgsql-bugs by date

Next:From: Heikki LinnakangasDate: 2006-10-20 08:49:47
Subject: Re: Freezing is not WAL-logged
Previous:From: Lachhman DassDate: 2006-10-20 07:37:27
Subject: Re: BUG #2698: Update table alias not supported

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group