[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Large strings not getting persisted in entity column annotat

molson_m do-not-reply at jboss.com
Wed Jun 27 19:50:41 EDT 2007


Hi,

I am in a very terrible situation. I am trying to persist large strings into a table column with type CLOB. My database is in Oracle. I am using JPA and noticed that its fine with small strings, but crashes badly with the exception "streams type cannot be used in batching" ; if the strings are of size around 700 to 1000 characters. It would be great if anyone can help me regarding this issues. The following is my sample code and exception

Entity Class


  | @Entity
  | public class Report implements Serializable{
  | 
  |    private int id;
  |    private String reportContent;
  | 
  |   @Id
  |   @GeneratedValue(strategy = GenerationType.AUTO)
  |   @Column(name="REPORT_ID")
  |   public int getId () {
  |     return id;
  |   }
  |   public void setId (int reportID) {
  |     this.id = reportID;
  |   }
  | 
  |   @Lob 
  |   @Basic(fetch=FetchType.LAZY)
  |   public String getReportContent () {
  |     return reportContent;
  |   }
  | 
  |   public void setReportContent (String reportContent) {
  |     this.reportContent = reportContent;
  |   }
  | 
  | }
  | 
  | 


  | 2007-06-26 09:31:45,173 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 17090, SQLState: null
  | 2007-06-26 09:31:45,173 ERROR [org.hibernate.util.JDBCExceptionReporter] operation not allowed: streams type cannot be used in batching
  | 2007-06-26 09:31:45,173 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session
  | org.hibernate.exception.GenericJDBCException: could not update: [au.com.thedistillery.validate.persistence.reporting.ReportContent#2]
  | 	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
  | 	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
  | 	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
  | 	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)
  | 	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
  | 	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
  | 

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

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



More information about the jboss-user mailing list