【发布时间】:2017-02-20 08:49:05
【问题描述】:
目前,我正在使用 Spring 4.0.6 和 Postgresql 9.5。我将一个 serviceClass1 呼叫到另一个 serviceClass2 并获得如下事务的异常:
serviceClass1.class
`@Transactional(readOnly = false, propagation = Propagation.REQUIRED,rollbackFor= { Throwable.class })
public Map<String, Object> storeUsersList(Map<String, Object> mapOfParams) throws Exception {
Map<String, Object> returnMap = new HashMap<String, Object>();
if (userListToStore != null && !userListToStore.isEmpty()) {
integrationService.manangePassCodes(org,userListToStore.size());
for (Users singleUser : userListToStore) {
try {
getEm().update(singleUser);`
serviceClass2.class
@Override
@Transactional(readOnly=false,propagation=Propagation.REQUIRED
,rollbackFor{Throwable.class})
public void manangePassCodes(Organizations org,int userToRegisterCount)throws Exception{
//some Logic
我在这个地方遇到异常 -
getEm().update(singleUser);
异常 SQL 状态 [25P02];错误代码[0];无法提取 结果集
我刚刚阅读了有关 Postgres 事务的此错误,但无法了解我应该为 Hibernate 使用什么。
【问题讨论】:
标签: java spring hibernate jpa postgresql-9.5