3,433 questions
1
vote
0
answers
139
views
Too many unwanted SQL queries calls from Mybatis implementation in Spring boot Java
Before starting I want to clarify that I use Oracle, MyBatis and Springboot Java in my API. One of the solutions I applied was to increase the lifetime of my Oracle session to 12h to avoid this ...
0
votes
0
answers
61
views
Why does appending an extra “#†to my Oracle common user fix the login issue?
I'm encountering a very bizarre problem with an Oracle database connection in a Java API from a teammate. The application runs fine for everyone else, but on my machine and in the machine from just ...
0
votes
0
answers
24
views
How to use auto-generated ID in multiple INSERT statements within single MyBatis insert tag?
I want to implement the following functionality in MyBatis:
Execute two INSERT queries with a single insert tag
Use the auto-incremented ID (id1) generated from the first INSERT in the second INSERT ...
1
vote
1
answer
31
views
MyBatis annotation function where IN list of uuids
I have a list of UUIDS of users where I need to decrease a number of gold by a given amount.
MyBatis function:
@Update(
"""
UPDATE users
SET gold = gold - #{amount}
<...
0
votes
0
answers
52
views
MyBatis insert returns without exception, but the database is not updated even though I have called commit()
This is my first attempt at an insert with MyBatis, so I'm assuming I've missed some vital step or other!
I'm attempting a fairly simple insert into an sqlite database:
<insert id="insertClub&...
0
votes
1
answer
53
views
Insert Java boolean into Postgresql boolean via Mybatis
I fail to insert a java boolean into a postgresql boolean column via mybatis. I get the below error. Why does it think 'expression is of type integer'? It's all boolean.
org.springframework.jdbc....
0
votes
0
answers
41
views
MyBatis3 There is no setter for property named '1' in 'class java.lang.String'
I have a problem, I need to query all the data by the table name, but recently found a problem, I reported an error when querying a customer table.
Cause: org.apache.ibatis.reflection....
0
votes
1
answer
55
views
MyBatis fails on one-to-many relationship with TooManyResultsException: Expected one result ... but found: 2
I have two classes which are, for now very simple:
class Club {
private int id;
private String name;
private Set<Player> players;
}
class Player {
private int id;
private String ...
-1
votes
1
answer
31
views
Spring fails bean creation from unspecified package
I've created an artifact "MyElectricity-aWattar" which deals with a MariaDB database on behalf of MyBatis. It works fine.
The is also another artifact "MyElectricity-Sungrow" which ...
0
votes
1
answer
55
views
Use Collection of Pairs For Insert Statement?
I have a table with a compound primary key, and I want to do a bulk insert for all keys (data migration/staging).
Currently it looks like, if you pass a collection to a MyBatis insert, it expects all ...
0
votes
0
answers
29
views
Can I use sql phrase that "alter session [session id] stop grace" in mybatis mapper?
I use update tage in mybatis mapper.
<update id="stopSessionGracefully" parameterType="com.project.dao.dto.StopSessionReqDaoDto">
ALTER SESSION #{sessionId} STOP GRACE
&...
0
votes
2
answers
77
views
MyBatis handler Issue in my Spring Boot Example for Map Object
I have a problem to implement custom handler for Map through MyBatis in my Spring Boot example.
Here is my request object shown below
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public ...
0
votes
1
answer
110
views
Verifying transaction rollback in spring-boot integration test
I am trying to write an integration test that verifies database rows are rolled back if one of the operations in a transaction fails. However, though I see the rollback being triggered, my database ...
1
vote
2
answers
63
views
ExecutorService Callable thread mybatis insert 1M+ records throws CannotGetJdbcConnectionException Failed to obtain JDBC Connection
Below is Hikari connection settings
spring.datasource.hikari.connection-timeout=600000
spring.datasource.hikari.idle-timeout=300000
spring.datasource.hikari.max-lifetime=1800000
spring.datasource....
0
votes
1
answer
37
views
How to make spring JPA auto conversion similar to mybatis
In mybatis : Column conversion will happen automatically for columns in select:
Ex : I have a select query with only 2 columns. but i want to map this 2 columns into en entity which is common to a ...