[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2614) Blob Length Set to 255 By Default With Derby DB

Penkov Vladimir (JIRA) noreply at atlassian.com
Thu Dec 24 05:40:32 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35032#action_35032 ] 

Penkov Vladimir commented on HHH-2614:
--------------------------------------

This bug prevent jbpm to deploy new process:
{code:title=Test.java|borderStyle=solid}
NewDeployment deployment = repositoryService.createDeployment();
deployment.addResourceFromUrl(new ClassPathResource(processDefinition).getURL());
deployment.deploy();
{code}
{noformat}
Caused by: org.hibernate.exception.DataException: could not insert: [org.jbpm.pvm.internal.lob.Lob]
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2140)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2503)
	at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
	at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
	at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:962)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1107)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
	at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:95)
	at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:65)
	at org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:70)
	at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.list(ProcessDefinitionQueryImpl.java:141)
	at org.jbpm.pvm.internal.repository.ProcessDeployer.checkKey(ProcessDeployer.java:134)
	at org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:93)
	at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46)
	at org.jbpm.pvm.internal.repository.RepositorySessionImpl.deploy(RepositorySessionImpl.java:61)
	at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:47)
	at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:33)
	at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
	at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
	at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:77)
	at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
	at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
	at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
	at org.jbpm.pvm.internal.repository.DeploymentImpl.deploy(DeploymentImpl.java:91)
	at fotobank.web.cms.admin.workflow.Workflow2Bean.setupProcessDefinitions(Workflow2Bean.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:297)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:250)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:144)
	... 36 more
Caused by: java.sql.SQLException: A truncation error was encountered trying to shrink BLOB '(Binary data value not displayed)' to length 255.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
	at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2120)
	... 72 more
Caused by: ERROR 22001: A truncation error was encountered trying to shrink BLOB '(Binary data value not displayed)' to length 255.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.types.SQLBinary.checkHostVariable(Unknown Source)
	at org.apache.derby.exe.ac691b824dx0125xc03ax921ax000000189a102.e0(Unknown Source)
{noformat}

> Blob Length Set to 255 By Default With Derby DB
> -----------------------------------------------
>
>                 Key: HHH-2614
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2614
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.3
>         Environment: Apache Derby 10.2.2, Java 1.6.0
>            Reporter: Sean Sylvis
>
> When the (Hibernate) type "blob" is used in an object mapping file and a length is not specified, Hibernate converts this type as "blob (255)" to the Apache Derby database table definition. (This seems to be the same as the conversion behavior of a Java String to "varchar (255).") The same behavior results when using a CustomType that returns a Java SQL Types.BLOB. This is not the behavior I expected.
> Hibernate converts the same type as simply "blob" (which has a maximum length of 65535 bytes when no length is specified) when using MySQL version 5.0 (http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html). Furthermore, the Derby specification (http://db.apache.org/derby/docs/10.2/ref/rrefblob.html) states that a blob type without a length value will default to a length of 2M-1 bytes.
> I could not find a length specification for the Java SQL Blob type (http://java.sun.com/javase/6/docs/api/), but the current default length does seem to conform to other Hibernate type standards. That is, if a length is not specified, the length defaults to the maximum length defined for that type by the database.

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list