I’m using jboss and cmt and have seen strange behaviour when using requires_new on an ejb method that I loop over from another bean to insert some records. I see that intermittently after restarting the jboss the operations in the method aren’t committed to db after the method is finished.So, I have tried to use TransactionSynchronizationRegistry and found that when the data isn’t committed I actually don’t get a new transaction each time the method is entered. Anyone who has heard of jboss acting this way? I'm using ejb, jboss, jpa, Hibernate, cmt.
Related Questions in JBOSS
- Spring's XML based bean configuration for Object Mapper's Case Insensitive property
- jboss configuration via ipv6 version jboss-eap-7.4
- class org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher does not implement jakarta.servlet.Servlet
- Eclipse deploy to Local JBOSS fails
- JBoss 4.x to Glassfish 2022 and Java 6 to Java 8 causes 1 non-XA Resource Exception
- SM Session Authentication issue from Site Minder getting HTML Login Page
- Facing [io.undertow.request.io] (default task-4) Exception handling request to /business-central/: java.io.IOException: UT010029: Stream is closed
- How to get the current number of in-use bean instances (MDB) from Wildfly?
- JConsole of JBoss EAP 7.1.1.0.10 has differences between two installation
- In what order are the bean instance pools settings applied in Jboss 7.3
- Spring boot app in WildFly 7 - endpoint not found
- how does one fix a class not found error in jboss 7.4?
- Unable to start Jakarta EE based JSF web application on JBoss EAP 7.4.6
- Deploying Jakarta EE 9 on JBoss 7.4
- How can I create a container from the jboss amq-7-broker-image repo image
Related Questions in TRANSACTIONS
- How to design the file operation interface involving status and transactions?
- Internal events cannot be consumed in spring boot. Only when using Kafka Consume
- How do you categorize a pending transaction immediately after making a purchase and have it save?
- Spring JPA + Hibernate + Rest services + long time transactions
- How to Identify Specific Transaction Anomalies in a Given Schedule?
- When does shared and exclusive locks are acquired and released in a MySql transactions?
- How to write a reusable DB transaction wrapper?
- "No data" after sending tx Jupiter Swap Python
- Perform multiple Identity actions in a transaction
- Running a program on different computers with different users that access a central database simultaneously - VB.NET XAMPP/MySQL
- Proper way to implement transactional HOTP?
- Transactional role in Java Spring Boot
- Is there a way of increasing MAX_INTEGER in web3.js
- Single transaction, multiple service calls to Entity Framework updating database
- Saving to Reactive Redis and Postgres in a single transaction
Related Questions in ANNOTATIONS
- Is there a VB.net way to clear/remove Vertical Line annotations?
- control javac options per class from annotation processor
- Why does openshift ingress not allow router annotations?
- External annotation processor not working
- How to inherit and use swagger’s schema annotation
- Adding Annotation with PDF.js
- Remove annotation from subtree commits (--unannotate) when Git subtree becomes a standalone repository
- Missing categorical annotations in R pheatmap() despite no missing values in data
- Is there a philosophical reason why jUnit 5 uses annotations rather than classes or interfaces?
- Does the [NotifyCanExecuteChangedFor] Annotation Not Work in Combination with ObservableCollection?
- Playwright annotations expect 2 arguments but got 3
- Is there an equivalent to @BeforeAll in JMH(Java Microbenchmark Harness), Level.Trial is not working
- The value '' is not valid for
- Spring Boot: @Autowired throws 'UnsatisfiedDependencyException' while testing
- I need Visual Code Studio to Auto Suggest parameter details for my functions, Where and how I do that?
Related Questions in JTA
- Is there any possibility to use JTA with Spring Framework 6 and Tomcat or Payara?
- What is openliberty transaction manager backend routing?
- Hibernate executes update SQL statement but the update is not written to database
- Error initializing TransactionManager. Could not instantiate TransactionConfig
- Is calling method of EntityManager in a container-managed transaction context inside Servlet thread-safe?
- problematic read commited behavior - what should i expect?
- Handle transactions with BMT
- Implementing 2 phase commit in Websphere application server
- How to transactionally write a Kafka record and persist it using JDBC in Quarkus/Kotlin
- Why does @Transactional not work, but writing it manually does work
- EJB Hibernate Nested Transaction doesn't Roll Back despite I throw an Exception annotated with @ApplicationException(rollback=true)
- JaVers + Spring Boot 3 + JTA + Atomikos
- Distributed Transaction Handling on single Database (SpringBoot, JMS, JPA)
- Spring boot 3 with Atomikos
- What is the correct way to persist entities based on other entities being updated in the same transaction?
Related Questions in CONTAINER-MANAGED
- How to update more than one object at a time using a JPA OneToMany relationship?
- Container Managed Transactions - Asynchronous method calls
- How to change the status of container managed transaction which is marked for rollback
- How welcome page works when using JDBC Realm?
- Hash+Salt Passwords using Container Managed Authentication/Authorization
- Spring authentication against tomcat-users.xml
- (OpenJPA/WAS) How to use the Container Managed Authentication for the Container Managed Entity Manager
- Container managed auth, handle currently logged-in user
- Transaction mixing in Java EE ( container-managed beans method called inside bean managed method )
- Issue with Container managed transaction (openJPA + Spring + WAS 8.5)
- Glassfish container managed database location
- Container Managed Transactions can not rollback
- Bean Managed MDB and Database exceptions
- Cannot authenticate through JBoss AS 7 security subsystem
- JPA newbie - Container managed persistence using Websphere and OpenJPA
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
So, I've finally solved this problem. I used this great blog post
http://piotrnowicki.com/2011/11/am-i-in-the-same-transaction-am-i-using-the-same-persistencecontext/
to make sure that I actually was in the same transaction after entering the method annotated REQUIRES_NEW. So then I understood that JBoss intermittently ignored the annotation and defaulted to REQUIRED instead. This was because multiple classes implemented the same interface. So I simplified it so that I now have one interface, annotated @Local, and one implementing class where the REQUIRES_NEW annotated method is. I understand that in this case it was our code that was wrong so it's not really a bug in Jboss way of handling transactions. But it's really strange that there isn't as much as a warning in the logs that there is a race condition. I could restart the Jboss and get a different behavior than before the restart. I think that's strange. I haven't found much about that this could be a problem after googling so I hope that this answer can save some time for someone else.
Edit: It's not about multiple implementing classes, just about declaring all the methods in the interface annotated @Local, otherwise JBoss might ignore the attributes