我正在从Liferay论坛上复制-2周内没有得到回复。http://www.liferay.com/community/forums/-/message_boards/message/9384663
我正在寻找文档/博客如何Liferay交易。
Liferay 6.0.6 PostgreSQL
我有一个jax-ws web服务的钩子。我只使用Liferay服务。
例如,插入文档并为其添加标签
fileEntry = DLFileEntryServiceUtil.addFileEntry(groupId, folderId, filename, filename, description, changeLog, "extraSettings", buffer, serviceContext);
AssetEntry assetEntry = AssetEntryLocalServiceUtil.getEntry(DLFileEntry.class.getName(), fileEntry.getFolderId());
AssetTagUtil.addAssetEntry(assetTagObj.getPrimaryKey(), assetEntry.getPrimaryKey());
我需要设置事务。
我的类注释
@MTOM
@WebService(targetNamespace="http://services.portal.xyz/",serviceName="AuditResultService",name = "AuditResult", endpointInterface = "xyz.portal.services.AuditResultWS")
@Transactional(isolation = Isolation.DEFAULT, readOnly = false, rollbackFor = {PortalException.class, SystemException.class, InvalidParameterException.class, NoSuchEntryException.class})
@Transactional是救世主
方法仅使用
@WebMethod
WS工作得很好,但是没有创建事务文档,并且在NoSuchEntryException文档保留在Liferay之后。
基于下面的论坛帖子尝试:http://www.liferay.com/community/forums/-/message_boards/message/9019161
portal-ext.properties
transaction.manager.impl=org.springframework.transaction.jta.JtaTransactionManager
transaction.manager.property.allowCustomIsolationLevels=true
transaction.manager.property.globalRollbackOnParticipationFailure=true
我没有在我的钩形弹簧配置中做任何事情。
我试图改变孤立等等,但都没有成功。
请问有什么导游吗?
非常感谢
发布于 2015-02-27 07:10:02
如果在事务部分中抛出异常,任何东西都可能是事务性的。在liferay中,事务仅在服务实体的方法内处理,即...ServiceUtil类。您必须在方法的名称前面加上CRUD操作。所以你必须创建一个“虚拟”实体..这是更简单的方法。
发布于 2020-04-09 13:38:16
发布于 2012-10-27 19:02:08
如果您不一定需要在一个事务中调用所有3个方法,请调用AssetTagServiceUtil而不是AssetTagUtil。addFileEntry调用在文件系统上创建一个文件,该文件系统无论如何都不是事务性的。
如果您真的坚持让所有事务都在一个事务中创建将从web服务调用的自定义服务。
原因是Liferay中的事务管理器仅扫描服务上的@ trasaction注释。
https://stackoverflow.com/questions/6490278
复制相似问题