[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Error reading a CMP Bean from mysql 5.0

caerlama do-not-reply at jboss.com
Tue Aug 15 12:02:51 EDT 2006


Hi,

I am trying to read the String representation of an xml document from a mysql Database (column of type longblob) using the CMP facilities without success.

Something about my environment:
JBoss 4.0.4.GA
MySql 5.0.21 (both running in Linux SuSe 9.0 kernel 2.6.11.11)
mysql-connector-java-5.0.3. (I also tested mysql-connector-java-3.0.8-stable-bin.jar )
jre 1.4.2 

I do the following steps

1.	I write the string in the database (column of type longblob) using the set Method of my CMP Bean
2.	I test the String was written correct using the mysql client
3.	after that the application tries to read the String using the get Method of my CMP Bean and the result of this is not correct (I expected the xml document and got something like ?[A8 at l4f.? 
the strangest thing is that I obtain the correct result if i use a mysql 4.0 Server on a Windows XP Server.

im not getting some exceptions

Here the description of the used datatypes:
/**
	 * <!-- begin-user-doc --> CMP Field source
	 * Returns the source
	 * @return the source
	 * <!-- end-user-doc -->
	 * <!-- begin-xdoclet-definition -->
	 * 
	 * @ejb.persistent-field
	 * @ejb.persistence column-name="source" jdbc-type="VARCHAR"
	 *                  sql-type="LONGBLOB" read-only="false"
	 * 
	 * 
	 * @ejb.interface-method
	 * <!-- end-xdoclet-definition -->
	 * @generated
	 */
	public abstract java.lang.String getSource();

	/**
	 * <!-- begin-user-doc --> Sets the source
	 * @param java.lang.String
	 *            the new source value <!-- end-user-doc -->
	 * <!-- begin-xdoclet-definition -->
	 * @ejb.interface-method <!-- end-xdoclet-definition -->
	 * @generated
	 */
	public abstract void setSource(java.lang.String source);

Any Ideas?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965307#3965307

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965307



More information about the jboss-user mailing list