Hibernate / Oracle / Spring:java.sql.SQLException:违反协议

时间:2012-03-21 14:28:32

标签: oracle spring hibernate maven oracle10g

当我尝试使用Hibernate / Oracle 10.2执行更新hql时,请帮助我,我收到以下错误:

我正在使用Java 1.6。

在我的专家:

<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>

例外:

Caused by: org.springframework.transaction.TransactionSystemException: Could not roll back JPA transaction;
Caused by: org.hibernate.TransactionException: rollback failed
Caused by: org.hibernate.TransactionException: unable to rollback against JDBC connection
Caused by: java.sql.SQLException: Protocol violation

感谢。

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。 我已经改变了我的代码,只是删除了cascade属性:

@OneToMany(fetch = FetchType.LAZY, mappedBy = "scheduleRequest", cascade = CascadeType.ALL)
public Set<AdhocDetail> getAdhocDetails() {
return this.adhocDetails;
}

为:

@OneToMany(fetch = FetchType.LAZY, mappedBy = "scheduleRequest")
public Set<AdhocDetail> getAdhocDetails() {
return this.adhocDetails;
}

感谢。