transactional

[QueryDSL/Spring]java.lang.IllegalStateException: Connection is not transactional

我们两清 提交于 2019-12-10 15:44:56
问题 I writing Spring+Vaadin application. I wanted to add QueryDSL to access db (Oracle). I looked in documentation (http://docs.spring.io/spring-data/jdbc/docs/current/reference/html/core.querydsl.html) and I read that Spring recommend using standard QueryDSL api. I improted to my project following dependecies: <dependency> <groupId>com.mysema.querydsl</groupId> <artifactId>querydsl-sql-spring</artifactId> <version>${querydsl.version}</version> </dependency> <dependency> <groupId>org

HowTo extend Spring Annotation @Transactional

廉价感情. 提交于 2019-12-10 13:13:03
问题 I have to use 3 different transaction managers in my webapp. So I wrote my own Annotation according to the Spring reference (Section 10.5.6.3 Custom shortcut annotations). One annotation (for using one specific transactionmanager) looks like this: import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.transaction.annotation.Transactional; @Target({ElementType

Transactionally writing files in Node.js

为君一笑 提交于 2019-12-10 03:24:27
问题 I have a Node.js application that stores some configuration data in a file. If you change some settings, the configuration file is written to disk. At the moment, I am using a simple fs.writeFile . Now my question is: What happens when Node.js crashes while the file is being written? Is there the chance to have a corrupt file on disk? Or does Node.js guarantee that the file is written in an atomic way, so that either the old or the new version is valid? If not, how could I implement such a

Spring Transactional annotation, isolation not working for READ_UNCOMMITTED

眉间皱痕 提交于 2019-12-08 21:19:24
I have a method in Java which is wrapped by a spring Transactional annotation. I have 2 operations inside, one is delete , another one is insert . My insertion statement have to rely on the first operation (which is the delete ), but now because of the first operation is not committed yet, my insertion fail (unique constraint). But this is funny that, usually within the same transaction, I should be able to read/see the uncommited operation in the same transaction (my old proprietary framework are able to do that), but this is not happening for my scenario, the second insertion still fail

Spring Transactional not working

夙愿已清 提交于 2019-12-08 09:39:05
问题 I'v setup a Spring/Hibernate backend based on following example using Spring 4.1 and Hibernate 4.3.6: http://www.sivalabs.in/2011/02/springhibernate-application-with-zero.html I basically got everything working so far, but there is one little configuration problem I can't overcome: If I try to save an Entity I get the following StackTrace: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into

Hibernate @Transactional Sessions

断了今生、忘了曾经 提交于 2019-12-08 08:01:22
问题 I am sorry, that i repeat question that have been here for many times. I have problem with Transactional annotation. I have such classes and interfaces Dao, DaoImpl and Service, ServiceImpl. here is my conf files <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation

AspectJ Load Time Weaving with Spring Transaction Manager and Maven

こ雲淡風輕ζ 提交于 2019-12-08 07:24:51
问题 I'm attempting to enable load time weaving with Spring's transaction manager but without too much luck. Currently I'm just trying to run a simple em.persist() in a @Transactional method but it does not appear to running a transaction as seen through: TransactionSynchronizationManager.isActualTransactionActive() My application context file contains : <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"> <property name="persistenceUnitName" value=

Issue with @Transactional annotations in Spring JPA

試著忘記壹切 提交于 2019-12-08 04:52:44
问题 I have a doubt related to transactions within transactions. For background, I have a School entity object which has Set of Students entity object mapped to it. I am using Spring Data JPA which is taking care of all the crud operations. I have a SchoolManagementService class which has @Transactional(readonly=true) set at the class level and for all updating methods I am using @Transactional over them. In my SchoolManagementService class I have a method deleteStudents(List) which I have marked

Commit during transaction in @Transactional

天大地大妈咪最大 提交于 2019-12-07 11:02:47
问题 Is that possible to perform commit in the method that is marked as Spring's @Transactional ? @PersistenceContext private EntityManager em; @Transactional(propagation = Propagation.REQUIRED) public void saveMembersWithMultipleCommits(List<Member> members) throws HibernateException { Iterator<Member> it = members.iterator(); while (it.hasNext()) { while (it.hasNext()) { Member wsBean = it.next(); em.persist(wsBean); // overall commit will be made after method exit log.info("Webservices record "

What is interface-based proxying?

会有一股神秘感。 提交于 2019-12-07 06:56:36
问题 I was reading this regarding to where to place Transactional(interface vs implementation): The Spring team's recommendation is that you only annotate concrete classes with the @Transactional annotation, as opposed to annotating interfaces. You certainly can place the @Transactional annotation on an interface (or an interface method), but this will only work as you would expect it to if you are using interface-based proxies. The fact that annotations are not inherited means that if you are