Skip to content
Advertisement

Tag: spring-data

Spring boot “no transaction is in progress” with 2 datasources

I have two databases and i’m trying to save some records to both of them inside a service method. This gives me the error: org.springframework.dao.InvalidDataAccessApiUsageException: no transaction is in progress; nested exception is javax.persistence.TransactionRequiredException: no transaction is in progress. Here is entities: And here is one of the config files for multiple db connection: And here is the other one:

Spring Data Jpa Repository not saving entities to database

Im having some difficulties using jpa. Im not getting any exceptions, but I cant save anything to the database. I went from Hibernate to Jpa and everything worked perfectly there. Below are my Files application.properties: Model: Repository: Service: I’m getting a 200 Response when submitting the form, but can’t find the data in the database Answer You are using a

MongoDB Aggregation Pipeline – Count no of records that are matching a complex criteria – (Couldn’t find PersistentEntity for type java.lang.Object!)

I have documents with dynamic fields and I would need to find a count of matching records for a given complex query criteria Example Entity Example Data: Expected Query Criteria: Building such complex Criteria using $match would be too much of implementation, so I was trying to use SPEL evolution through $project like below: However, the above logic failing due

Java spring userRegister creates two database entries instead of one

As above this creates two database entries in user table. The process should be following: a new user enters their email and password -> saved in login table user confirm Email address -> entry in user table with username (email) and first&second name should be null at first. For second the code would be like that (working) is returning {“answer”:”done”,”username”:null}

Apache Ignite 2.11.0 :: Missing ignite-spring-tx-ext in maven repository

We are trying to upgrading from 2.9.1 to 2.11.0 and we have already using org.apache.ignite.transactions.spring.SpringTransactionManager which is now not available in core lib, when we checked docs https://ignite.apache.org/docs/latest/extensions-and-integrations/spring/spring-tx#maven-configuration its suggesting to use ignite-spring-tx-ext. But when we used that in pom.xml, its repository dose not exist in Maven repository. Can some please help us how to solve this. Answer Starting from

How to handle an error when database returns null value for one of the columns in the table

I’m using Java and Spring Boot with JPQL to access the data. I’m getting the below error because hourlyRate is null in the database: Caused by: org.hibernate.QueryException: could not instantiate class [com.example.model.response.school.Employee] from tuple. I still would like to be able to get the data from the database even when that column has null value in the database and send

Advertisement