春は実際にあなたのプロパティを読み取ることができるようにあなたがSpringBoot 1.4を使用している場合、私は、エラーを再現するが、私はあなたのプロパティファイルを修正任せることはできません。
post with the same errorで見つかったように、問題を解決するために、datasource.max-active
などのプロパティを増やそうとしていますか?
spring.datasource.url = jdbc:derby:/spring-boot/db;create=true
spring.datasource.username = admin
spring.datasource.password = 1234
# this one is incorrect
# spring.datasource.driver = org.apache.derby.jdbc.EmbeddedDriver
# replace with the one below, otherwise Spring will use his own
# derby driver
spring.datasource.driver-class-name = org.apache.derby.jdbc.EmbeddedDriver
# this one is incorrect as well
# hibernate.dialect = org.hibernate.dialect.DerbyDialect
# use the following way
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.DerbyDialect
spring.jpa.generate-ddl = true
spring.jpa.hibernate.ddl-auto = update
spring.jpa.properties.hibernate.current_session_context_class = org.springframework.orm.hibernate4.SpringSessionContext
# and in order for these guys to work you have to know
# spring.datasource.max-active=100
# spring.datasource.max-idle=8
# spring.datasource.min-idle=8
# your dbcp and look for documentation
# below is the example for Tomcat
spring.datasource.tomcat.max-active=100
spring.datasource.tomcat.max-idle=8
spring.datasource.tomcat.min-idle=8
# make sure you check out the logging
# this is IMPORTANT to see that your
# properties were ACTUALLY picked up
logging.level.org.springframework.web = DEBUG
logging.level.org.hibernate = DEBUG
前:プロパティはthis default application propertiesにない場合
だから、あなたはあなたが以下にapplication.properties
ファイルを変更するには、この私のアドバイスによると
spring.jpa.properties.*= # Additional native properties to set on the JPA provider.
としてそれらを記述する必要があります困難を克服するのに役立つ最後の3つのプロパティは、解決するのが最も難しいです。私はthis post here, last answerから知識を選んだ。それはSpring Boot 1.4.1.RELEASE documentationへのリンクもあります。
最後に、max-idle
のプロパティが実際には春によって取得されたことを確認する必要があります。それで、私は2つの最後のログとデバッグプロパティーを追加しました。
ログファイルを注意深く見た場合、設定されている値を確認してください。ここでは、その行が私のために
2016-11-17 11:40:27.875 DEBUG 32079 --- [ main] o.hibernate.internal.SessionFactoryImpl : Instantiating session factory with properties: {java.vendor=Oracle Corporation, sun.java.launcher=SUN_STANDARD, catalina.base=/tmp/tomcat.736868414125414090.8080, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, catalina.useNaming=false, hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy, os.name=Linux, sun.boot.class.path=/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/resources.jar:/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/rt.jar:/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/sunrsasign.jar:/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/jsse.jar:/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/jce.jar:/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/charsets.jar:/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/jfr.jar:/usr/users/nikiforo/src/jdk1.8.0_73/jre/classes, hibernate.current_session_context_class=org.springframework.orm.hibernate4.SpringSessionContext, java.vm.specification.vendor=Oracle Corporation, java.runtime.version=1.8.0_73-b02, user.name=nikiforo, javax.persistence.validation.mode=AUTO, user.language=en, sun.boot.library.path=/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/amd64, PID=32079, java.version=1.8.0_73, user.timezone=Europe/Berlin, sun.arch.data.model=64, java.endorsed.dirs=/usr/users/nikiforo/src/jdk1.8.0_73/jre/lib/endorsed, sun.cpu.isalist=, sun.jnu.encoding=UTF-8, file.encoding.pkg=sun.io, file.separator=/, java.specification.name=Java Platform API Specification, java.class.version=52.0, user.country=US, java.home=/usr/users/nikiforo/src/jdk1.8.0_73/jre, java.vm.info=mixed mode, os.version=4.1.20-11-default, hibernate.boot.Cfg[email protected]6abb7b7d, hiberna[email protected]5c7dfc05{ConnectionPool[defaultAutoCommit=null; defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; driverClassName=org.apache.derby.jdbc.EmbeddedDriver; maxActive=100
をどのように見えるかであるそれは長いラインですが、あなたは私のために参照としてmax-active
が設定されました。あなたはそれが役立つかもしれthis mine GitHub project: derby-tomcat-database-error branch
をチェックし、私はダービーしようとしたシンプルな春データ-RESTアプリと次のプロパティでを見たい場合は、私が間違っているなら、私に知らせていないことがあり
、I'LL投稿を削除します。
一般的に、厄介なトランザクション管理や接続の混乱が原因です。 –