Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-234
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-234
Summary: Problem when SQL Server 2K TEXT type field mapped to type="serializable" in hbn.xml
Type: Bug
Status: Unassigned
Priority: Minor
Project: Hibernate2
Versions:
2.0 final
Assignee:
Reporter: dev danke
Created: Tue, 5 Aug 2003 11:40 PM
Updated: Tue, 5 Aug 2003 11:40 PM
Environment: Hibernate=2.0rc5, OS=Windows XP with SP1, JDK=1.4.2, JDBC Driver=JNetDirect's JSQLConnect dirver.
Description:
I noticed strange behavior using Hibernate with a TEXT type field in SQL Server. I have table called Address with a field named Notes of type TEXT. I used Hibernate's net.sf.hibernate.tool.ddl2hbm.Gui tool to generate the Java class and Address.hbn.xml mapping files for this table.
In the mapping file the property element for the notes field looks like this:
<property column="notes" length="2147483647" name="notes" type="serializable"/>.
When I tried using session.find(...) or session.load(...) Address objects from the database, I always got this exception: "java.io.StreamCorruptedException: invalid stream header".
But Hibernate is able to retrieve Address object successfully when I changed the mapping element to this: <property column="notes" length="2147483647" name="notes" type="string"/>.
In the Hibernate 2.0 downloaded docs, I didn't see any mention of a problem like this related to MS SQL Server 2000 or the JNetDirect driver.
Based on this experience my hunch is that either a) net.sf.hibernate.tool.ddl2hbm.Gui generates an incorrect property mapping element for TEXT type database fields or b) Hibernate has a bug handling database fields mapped to type="serializable".
Here's the SQL for my table:
create table ADDRESS
(
addr_id int primary key identity(1,1),
first_name varchar(20) not null,
last_name varchar(20) not null,
nick_name varchar(20),
home_phone varchar(20),
cell_phone varchar(20),
street varchar(50),
city varchar(20),
state varchar(20),
zip varchar(20),
email varchar(20),
group_name varchar(20) not null,
notes text
)
I apologize if this is a duplicate bug or has been fixed already.
Thanks for this great product.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|