transactional

ui:repeat inside a ui:repeat and LazyInitException

一曲冷凌霜 提交于 2020-01-06 06:35:46
问题 I'm currently experiencing a LazyInitException with a page containing code like the following: <h:form> <ui:repeat value="#{searchBean.storiesByTag}" var="iStory"> <ui:repeat value="{iStory.tags}"var="iTag"> <!-- Lazy init exception here --> #{iTag.content} </ui:repeat> </ui:repeat> </h:form> storiesByTag() is a bean method that retrieves a List of stories. The second ui:repeat is supposed to then take each tag and display it's content. All fetching is lazy by default to avoid loading more

ui:repeat inside a ui:repeat and LazyInitException

风流意气都作罢 提交于 2020-01-06 06:35:07
问题 I'm currently experiencing a LazyInitException with a page containing code like the following: <h:form> <ui:repeat value="#{searchBean.storiesByTag}" var="iStory"> <ui:repeat value="{iStory.tags}"var="iTag"> <!-- Lazy init exception here --> #{iTag.content} </ui:repeat> </ui:repeat> </h:form> storiesByTag() is a bean method that retrieves a List of stories. The second ui:repeat is supposed to then take each tag and display it's content. All fetching is lazy by default to avoid loading more

Understanding how nested Spring @Transactional works

℡╲_俬逩灬. 提交于 2020-01-05 09:53:37
问题 I'm porting an EJB application to Spring and I'm facing some issues. The application is running in standalone (that's why we choose spring) with eclipselink. In this application I need to create an Order, for which I first need to create a Customer, the OrderLines and then add a Payment for this Order. The problem is that I want to do all the insertion in a single Transaction so that if the payment fails to be persisted nothing must be persisted. I tried to achieve this but it looks like I'm

Understanding how nested Spring @Transactional works

风流意气都作罢 提交于 2020-01-05 09:53:34
问题 I'm porting an EJB application to Spring and I'm facing some issues. The application is running in standalone (that's why we choose spring) with eclipselink. In this application I need to create an Order, for which I first need to create a Customer, the OrderLines and then add a Payment for this Order. The problem is that I want to do all the insertion in a single Transaction so that if the payment fails to be persisted nothing must be persisted. I tried to achieve this but it looks like I'm

Spring WS interceptors with injected DAO's @Transactional not working

元气小坏坏 提交于 2020-01-04 05:58:18
问题 We have a legacy XML based configuration spring-ws application that contains endpointInterceptors that have DAOs injected to obtain configuration from the database. These DAOs have the hibernate sessionFactory injected. When we have upgraded to spring 4.2.0.RELEASE (from spring 3.2.5.RELEASE) and spring-ws 2.2.1.RELEASE (from spring-ws 2.1.4.RELEASE) I noticed that the DAO was not a proxy object and it seemed that the intercetor was going to the AnnotationActionEndpointMapping class instead

Can a git repository be corrupted if a command modifying it crashes or is aborted?

北战南征 提交于 2020-01-01 04:30:09
问题 When playing around with git , I sometimes try out things, then abort commands which take too long (e.g. some git svn commands that hang during network problems). This got me thinking: Is it always safe to forcefully abort a command (Ctrl-C or kill )? What if a command crasheds (out of memory, bug, network/FS problem)? Are repository changes "transactional" in the sense that incomplete changes are "rolled back" (like in a versioning filesystem)? Or do I risk repository corruption in that case

SpringMVC: @Transactional causes: No qualifying bean of type […] is defined

守給你的承諾、 提交于 2019-12-25 16:40:59
问题 My main function class: public class Database2Redis { public static void test(ApplicationContext applicationContext) { BaseFckImpl service = applicationContext.getBean(BaseFckImpl.class); // ... } public static void main(String[] args) throws Exception { ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-config.xml"); test(applicationContext); } } My BaseFck class: @Service public interface BaseFck { @Transactional void test(); } My BaseFckImpl class: @Service

Multiple SQL replication types

让人想犯罪 __ 提交于 2019-12-24 07:26:18
问题 We currently have two SQL databases that are utilizing a merge replication. We would like to setup a separate transactional replication off one of the databases to a third database. Is this possible? If so, do we need to change anything with our distributor? Thanks! 回答1: Yes this is possible. Nothing needs to change with the Distributor. However, if you ever have a Merge node receive data from a Transactional Replication topology then you will need to make sure the property @published_in_tran

java.lang.IllegalArgumentException: Cannot set to com.sun.proxy.$Proxy

半世苍凉 提交于 2019-12-23 19:00:26
问题 I am working on a web-app with Spring MVC. This is the exception I am getting: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: Can not set com.onclave.papercraft.DAO.tenantDAO.Implementation.UsersDAOImplementation field com.onclave.papercraft.DAO.tenantDAO.Controller.UsersDAOController.usersDAOImplementation to com.sun.proxy.

Controlling inner transaction settings from outer transaction with Spring 2.5

时间秒杀一切 提交于 2019-12-23 13:19:11
问题 I'm using Spring 2.5 transaction management and I have the following set-up: Bean1 @Transactional(noRollbackFor = { Exception.class }) public void execute() { try { bean2.execute(); } catch (Exception e) { // persist failure in database (so the transaction shouldn't fail) // the exception is not re-thrown } } Bean2 @Transactional public void execute() { // do something which throws a RuntimeException } The failure is never persisted into DB from Bean1 because the whole transaction is rolled