我定期得到错误:
错误JDBCExceptionReporter - > javax.resource.ResourceException:IJ000453:无法获取java的托管连接:jboss/datasources/myDB 08:12:05,928 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[ default-host].[/ mySoftware].[jsp]](ajp - xx.255.0.yyy-8109-21)Servlet jsp的Servlet.service()抛出异常:javax.resource.ResourceException:IJ000655:没有托管连接在org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:377)等配置的阻塞超时(30000 [ms])内可用.
.
所以,我有下一个数据源配置.在JBoss AS上:
<datasource jta="true" jndi-name="java:jboss/datasources/myDB" pool-name="ssbs-pssbs" enabled="true" use-ccm="true">
<connection-url>jdbc:postgresql://xx.255.0.yyy/myDatabase</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql-jdbc4</driver>
<pool>
<min-pool-size>30</min-pool-size>
<max-pool-size>150</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>tick</user-name>
<password>tack</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<timeout>
<blocking-timeout-millis>30000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
<statement>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
Run Code Online (Sandbox Code Playgroud)
在我的Postgres服务器上我允许500上的max_connection.为什么我得到这个例外?
我使用 Hibernate 4 和 Spring 3。
我有两个实体。
图书实体
@Entity
@Table(name = "book")
public class Book implements Serializable {
public Book() {
}
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue( strategy = GenerationType.IDENTITY)
private int id;
@ManyToOne()
@JoinColumn( name = "author_id" )
private Author author;
private String name;
private int pages;
@Version
@Column( name = "VERSION")
private int version;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Author getAuthor() { …Run Code Online (Sandbox Code Playgroud) 我是 Scala 的新手。我浏览教程并尝试创建一些有用的东西,但遇到了这样的奇怪错误:
value <> is not a member of (slick.lifted.Rep[Long], slick.lifted.Rep[String], slick.lifted.Rep[String], slick.lifted.Rep[String])
Run Code Online (Sandbox Code Playgroud)
我的代码:
package models
import java.sql.Timestamp
import slick.jdbc.MySQLProfile._
import slick.jdbc.MySQLProfile.api.stringColumnType
import slick.jdbc.MySQLProfile.api.longColumnType
import slick.jdbc.MySQLProfile.api.timestampColumnType
import slick.lifted.Tag
case class User(id: Long, name: String, email: String, PMAccount: String)
class Users(tag: Tag) extends Table[User](tag, "Users") {
def id = column[Long]("id")
def name = column[String]("name")
def email = column[String]("email")
def PMAccount = column[String]("PMAccount")
def * = (id, name, email, PMAccount) <> (User.tupled, User.unapply(_))
}
Run Code Online (Sandbox Code Playgroud)
谁能帮助我理解这一点?