org.hibernate.exception.DataException: could not insert collection: [org.fstool.io.fs.UserInfoAttributes.attributes#205]

Hibernate JIRA | Stephan Fuhrmann | 9 years ago
  1. 0

    Special characters do not seem to be quoted / escaped. This makes the database parser throw an exception if it encounters such a unescaped String: org.hibernate.exception.DataException: could not insert collection: [org.fstool.io.fs.UserInfoAttributes.attributes#205] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1183) at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:39) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:171) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301) at $Proxy0.flush(Unknown Source) ... Caused by: java.sql.BatchUpdateException: Batch-Eintrag 6 insert into attributes (id, property_name, property_value) values (205, 9, (¯`'<95>.?<95> a <95>?. <95>'?¯)) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2537) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1328) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2674) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1146) ... 22 more The offending character seems to be ISO 8859-1 0xb4 (ACUTE ACCENT). The map file excerpt for this: ... <map name="attributes"> <key column="id"/> <index-many-to-many column="property_name" class="org.fstool.io.fs.AttributeKey"/> <element column="property_value" type="string"/> <!-- this hurts --> </map> ... The application doesn't need to care about escaping because Hibernate does the job of O/R-mapping. The problem does NOT exist for the DerbyDialect - this works fine! Note: If characters get passed to the DB unescaped this is a security risk opening a hole for SQL injection! Therefore I marked this problem critical.

    Hibernate JIRA | 9 years ago | Stephan Fuhrmann
    org.hibernate.exception.DataException: could not insert collection: [org.fstool.io.fs.UserInfoAttributes.attributes#205]
  2. 0

    Special characters do not seem to be quoted / escaped. This makes the database parser throw an exception if it encounters such a unescaped String: org.hibernate.exception.DataException: could not insert collection: [org.fstool.io.fs.UserInfoAttributes.attributes#205] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1183) at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:39) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:171) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301) at $Proxy0.flush(Unknown Source) ... Caused by: java.sql.BatchUpdateException: Batch-Eintrag 6 insert into attributes (id, property_name, property_value) values (205, 9, (¯`'<95>.?<95> a <95>?. <95>'?¯)) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2537) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1328) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2674) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1146) ... 22 more The offending character seems to be ISO 8859-1 0xb4 (ACUTE ACCENT). The map file excerpt for this: ... <map name="attributes"> <key column="id"/> <index-many-to-many column="property_name" class="org.fstool.io.fs.AttributeKey"/> <element column="property_value" type="string"/> <!-- this hurts --> </map> ... The application doesn't need to care about escaping because Hibernate does the job of O/R-mapping. The problem does NOT exist for the DerbyDialect - this works fine! Note: If characters get passed to the DB unescaped this is a security risk opening a hole for SQL injection! Therefore I marked this problem critical.

    Hibernate JIRA | 9 years ago | Stephan Fuhrmann
    org.hibernate.exception.DataException: could not insert collection: [org.fstool.io.fs.UserInfoAttributes.attributes#205]
  3. 0

    Issue 2 - avh - hibernate session fails after exception - Australia's Virtual Herbarium (version 3) - Google Project Hosting

    google.com | 1 year ago
    org.hibernate.exception.DataException: could not insert: [avh.to.TaxonNameTO]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Insertat Blob con Openxava

    openxava | 8 years ago | fonchi
    org.hibernate.exception.DataException: could not insert: \[org.ibm.poc.entityBean.CpcArchivo\]
  6. 0

    Help! itracker with mysql 5.6

    itracker | 3 years ago | oam829
    org.hibernate.exception.DataException: could not insert: [org.itracker.model.Project]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.exception.DataException

      could not insert collection: [org.fstool.io.fs.UserInfoAttributes.attributes#205]

      at org.hibernate.exception.SQLStateConverter.convert()
    2. Hibernate
      AbstractCollectionPersister.recreate
      1. org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
      2. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      3. org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1183)
      3 frames
    3. Hibernate
      CollectionRecreateAction.execute
      1. org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:39)
      1 frame
    4. Hibernate
      ActionQueue.executeActions
      1. org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
      2. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
      3. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:171)
      3 frames
    5. Hibernate
      SessionImpl.flush
      1. org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
      2. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      3. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
      3 frames
    6. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    7. Hibernate
      ThreadLocalSessionContext$TransactionProtectionWrapper.invoke
      1. org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
      1 frame
    8. Unknown
      $Proxy0.flush
      1. $Proxy0.flush(Unknown Source)
      1 frame