1,818 questions
Best practices
0
votes
4
replies
93
views
SpringBoot JPA Entity Manager flush and clear functions helps in importing large data sets faster
I worked on a performance improvement of importing large dataset in SpringBoot JPA.
I Implemented batching of the records that I am saving to database and flushing and clearing the entity manager on ...
0
votes
1
answer
61
views
How can i get updated ones with Entity Manager?
I am querying with 1000 entities at a time (bulk) and some of them are insert queries and some are update queries. I want to find which entity I query with is the update query and create a list of ...
0
votes
1
answer
107
views
Single entity manager for multiple services in Spring Boot?
I have a Java project, let's call it 'magical' which defines some JPA entities, and manipulates them vía some services using Eclipselink.
One of those entities is the entity User.java. So, the '...
0
votes
0
answers
72
views
Why does Hibernate throw "cannot execute UPDATE in a read-only transaction" after a COUNT query when no join entries exist?
I am encountering a puzzling issue in Hibernate (with PostgreSQL backend) and would appreciate confirmation or correction of my understanding.
Context:
I have a method that runs a couple of scalar ...
0
votes
1
answer
62
views
Hibernate Entity Manager behaviour logging
We have two JPA entities, let's call them 'C' and 'P'. These Entities have a one-to-one optional relationship based on their primary keys. That is, Entity 'P' can exist without a related Entity 'C', ...
1
vote
1
answer
151
views
How to pass a decimal value from a database into a DTO without getting a no matching constructor found error?
I've got a Java app that uses an EntityManager to query an Oracle database and populate a simple DTO class.
This works fine for varchars and strings - but throws an error:
Could not determine ...
3
votes
0
answers
331
views
Quarkus: Changing timeout via @TransactionConfiguration can only be done at the entry level of a transaction
I'm trying to increase the timeout of a transaction in a Java Quarkus application. I already found some old answered questions, but none of them is working for me.
The solution that's also mentioned ...
1
vote
0
answers
95
views
JSR-352 batch job delays between chunks: how to reduce commit time without bulk delete?
I am running a JSR-352 batch job (concretely, Apache JBatch as implementation) in a JEE environment (WebSphere with EclipseLink as the JPA provider).
The batch processes database records in chunks and ...
0
votes
1
answer
107
views
Integration-Test: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor
I want to create a integration test against a database and clean it up afterwards in an wildfly/arquillian environment. But when I try to execute the Test I get a Could not create new instance of ...
0
votes
1
answer
93
views
Using custom entityManager in multi-threaded environment
I used EntityManager to do some custom queries, but I encountered some issues.
Firstly, I defined entityManager as a singleton bean,
@Configuration
public class PrimaryJpaConfig {
@Primary
@...
0
votes
1
answer
64
views
Spring data jpa entity manager scope
does spring data JPA bound entity manager to the current thread or the transaction?
Say I have a method annotated with @Transactional that is called all the time. Does spring uses the entity manager ...
2
votes
1
answer
68
views
LoggerFactory Exception
In my Java Application I need to use a connection pool, so I decided to implement HibernateCP. The problem is that I get this exception that I need to add this: org/slf4j/LoggerFactory. The full ...
2
votes
1
answer
92
views
EntityManager provider not found
I used hibernate EntityManager on standalone application (Without framework) .
this is my pom.xml :
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven....
2
votes
0
answers
78
views
How to ensure updated data with PESSIMISTIC_WRITE lock without using EntityManager.refresh?
I’m having an issue with a Hibernate query where I need to use a PESSIMISTIC_WRITE lock. The lock works fine in concurrent transactions, but the information returned by the query is outdated. To ...
1
vote
1
answer
3k
views
Spring Data JPA/Hibernate: JPQL constructor expressions- difference between using "new(..)" and not using it
I am using JPQL and projecting the specific returned fields into a different Class than the Entity. I can achieve it using at least the following 2 ways in JPQL with EntityManger (em in code):-
@Test
...