我正在将应用程序从Jboss 7as移植到Weblogic 12c.
到目前为止,我能够运行应用程序并在数据库中创建新记录.
但是,我只在尝试更新现有记录时才会收到以下错误;
Error committing transaction:
javax.ejb.TransactionRolledbackLocalException: Error committing transaction:
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwTransactionRolledbackLocal(EJBRuntimeUtils.java:231)
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:134)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:362)
at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetry(BaseLocalObject.java:205)
at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:46)
...
Caused by: weblogic.transaction.internal.AppSetRollbackOnlyException: setRollbackOnly called on transaction
Run Code Online (Sandbox Code Playgroud)
当我javax.persistence.EntityManager.merge(Object)在其事务是容器管理的无状态EJB中调用时,会发生错误.
我最初的想法是容器正在javax.transaction.UserTransaction.setRollbackOnly()某处调用,所以我将EJB的事务管理更改为BMT并自己管理事务.发生了同样的错误.
我怀疑我的Datasource或persistence.xml有问题.
下面是我的persistence.xml的属性
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="myunitname" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>myDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.max_fetch_depth" value="1"/>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.WeblogicJtaPlatform"/>
</properties>
Run Code Online (Sandbox Code Playgroud)
请协助.
我刚开始学习Haskell.我正在经历"真实世界Haskell"的练习,第3章,我对我不理解的行为感到难过.
我不明白为什么我grahamSort似乎没有正确地打破关系.该函数首先找到一个参考点P(直通grahamGetFirstCandidate),然后根据它们和P形成的角度对其他点进行排序.我使用(减去)余弦作为角度的代理.
grahamGetFirstCandidate似乎按预期工作.
代码(对不起,它可能不是很干净):
import Data.List as List
data TwoD = TwoD {
x :: Float,
y :: Float
} deriving (Show, Eq)
dotProduct :: TwoD -> TwoD -> Float
dotProduct (TwoD xa ya) (TwoD xb yb) = xa * xb + ya * yb
grahamGetFirstCandidate :: [TwoD] -> TwoD
grahamGetFirstCandidate [] = error "Trying to find point with minimum y in empty List"
grahamGetFirstCandidate (p:ps) = search p ps where
search :: TwoD -> …Run Code Online (Sandbox Code Playgroud)