Guest User

Untitled

a guest
Nov 21st, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. # HIKARI
  2. spring.datasource.type=com.zaxxer.hikari.HikariDataSource
  3. spring.datasource.hikari.idle-timeout=10000
  4. spring.datasource.hikari.connection-test-query=SELECT 1
  5. spring.datasource.hikari.maximum-pool-size=8
  6. spring.datasource.hikari.auto-commit=false
  7.  
  8. # DATABASE
  9. spring.datasource.url=jdbc:sqlserver://100000001:1433;databaseName=Asdf
  10. spring.datasource.username=...
  11. spring.datasource.password=...
  12. spring.datasource.testOnBorrow=true
  13. spring.datasource.validationQuery=SELECT 1
  14. spring.datasource.continue-on-error=true
  15.  
  16.  
  17. # JPA
  18. spring.jpa.hibernate.ddl-auto=update
  19. spring.jpa.properties.hibernate.dialect=com......config.SqlServer2012CustomDialect
  20. spring.jpa.database=sql_server
  21. spring.jpa.show-sql=true
  22. spring.jpa.properties.hibernate.jdbc.batch_size=100
  23. spring.jpa.properties.hibernate.cache.use_second_level_cache=false
  24. spring.jpa.properties.hibernate.order_inserts=true
  25. spring.jpa.properties.hibernate.order_updates=true
  26. spring.jpa.hibernate.use-new-id-generator-mappings=true
  27.  
  28. public class SqlServer2012CustomDialect extends SQLServer2012Dialect {
  29. public SqlServer2012CustomDialect() {
  30. registerColumnType(Types.VARBINARY, FINGERPRINT_COLUMN_LENGTH, FINGERPRINT_COLUMN);
  31. registerColumnType(Types.VARBINARY, "VARBINARY(MAX)" );
  32. //registerColumnType(Types.VARBINARY, "BLOB");
  33. //registerColumnType(Types.VARBINARY, "BINARY");
  34. }
  35. }
  36.  
  37. public final class DatabaseColumnDefinitions {
  38. private DatabaseColumnDefinitions(){}
  39.  
  40. public static final String FINGERPRINT_ENCODING = "UTF-8";
  41. public static final Charset FINGERPRINT_ENCODING_CHARSET = Charset.forName(FINGERPRINT_ENCODING);
  42.  
  43. public static final String FINGERPRINT_COLUMN = "VARBINARY(16)";
  44. public static final int FINGERPRINT_COLUMN_LENGTH = 16;
  45. }
  46.  
  47. com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from varbinary to BLOB is unsupported.
  48.  
  49. @Entity
  50. @Table(
  51. uniqueConstraints = {
  52. @UniqueConstraint(name = "rdjsonstore_fingerprint_unique",columnNames = "fingerprint")
  53. }
  54. )
  55. public class RDJsonStore implements Serializable, FingerprintIndexer {
  56.  
  57. @Column(nullable = false)
  58. @Id
  59. @GeneratedValue(generator = "rdjsonstore_sequence", strategy = GenerationType.SEQUENCE)
  60. @SequenceGenerator(name = "rdjsonstore_sequence", sequenceName = "rdjsonstore_sequence", allocationSize = 10000)
  61. private Long id;
  62.  
  63. @Lob
  64. @Basic
  65. @Column(nullable = false, length = FINGERPRINT_COLUMN_LENGTH, columnDefinition = FINGERPRINT_COLUMN)
  66. private byte[] fingerprint;
  67.  
  68. ...
  69.  
  70. ERROR 4980 --- [p-nio-80-exec-4] o.h.engine.jdbc.spi.SqlExceptionHelper : The conversion from varbinary to BLOB is unsupported.
  71. org.springframework.orm.jpa.JpaSystemException: could not execute query; nested exception is org.hibernate.exception.GenericJDBCException: could not execute query
  72. at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:333)
  73. at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
  74. at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:488)
  75. at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
  76. at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
  77. at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
  78. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  79. at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
  80. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  81. at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
  82. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  83. at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
  84. at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  85. at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
  86. at com.sun.proxy.$Proxy128.findAll(Unknown Source)
Add Comment
Please, Sign In to add comment