All Questions
Tagged with hibernate oracle-database
2,521 questions
-1
votes
1
answer
27
views
Caused by: org.hibernate.type.SerializationException: could not deserialize Caused by: java.io.EOFException: null
I have a generic hibernate exception:
Caused by: org.hibernate.type.SerializationException: could not deserialize
at org.hibernate.internal.util.SerializationHelper.doDeserialize(...
0
votes
2
answers
77
views
spring data jpa ORA-01795: maximum number of expressions in a list is 1000 [duplicate]
@Query("SELECT DISTINCT rh FROM RoleHead rh, RoleDmdLine rl"
+ " where rh.id=rl.id" + " and rl.id in (:roleListId)"
Iterable <RoleHead> findAllByLıne(@param("...
2
votes
1
answer
52
views
Ways to improve Batch query performance with Spring Query
I have one objective, which is to get the minimum possible query time for the bulk insert of N number of records using standard Spring Data JPA using a remote Oracle database. I have tried few of the ...
0
votes
0
answers
30
views
Migrate ibatis choose cases to native SQL
I have the following ibatis query which I want to migrate from Oracle to PostgreSQL with Hibernate.
BEGIN
INSERT INTO users(
user_id,
...
0
votes
1
answer
42
views
INFO [SequenceIdentityGenerator] - <HHH000067: Disallowing insert statement comment for select-identity due to Oracle driver bug>
I have enabled Hibernate logs in my application
spring.hibernate.show_sql=true
spring.hibernate.format_sql=true
spring.hibernate.use_sql_comments=true
Now I am able to see hibernate queries and ...
0
votes
1
answer
50
views
ORA-00060: deadlock detected while waiting for resource - SpringData Jpa
I've got deadlock in my SpringDataJpa - "ORA-00060: deadlock detected while waiting for resource".
The problem appears when then are a large number of queries.
Is sth wrong with given piece ...
0
votes
0
answers
46
views
Intermittent ORA-00904
I have the following entity T_CAR_TYPE.
CREATE TABLE "T_CAR_TYPE"
(
...Various Columns
"WHEEL_CC_BOUNDARY" NUMBER(3,0)
)
My entity column is defined as follows:
@Column(name = ...
0
votes
1
answer
80
views
How to bind UUIDs as VARCHAR parameter in a native query?
I'm adding a new column - uuid with varchar(36) type in Oracle DB.
I had a search query that searched by ids, now I need to add a similar query but using uuids instead.
@Column(name = "UUID")...
0
votes
1
answer
53
views
Hibernate 6 Postgres bytea, Oracle varchar2 mapping in a JPA Entity
I have a column in my jpa entity where it should be mapped to bytea in Postgres and varchar2(1024) in oracle.
@Column(name="users")
private String users;
I'm using hibernate 6.2.28.Final ...
0
votes
2
answers
58
views
How to map two entities that share columns and allow insert and update
I have some entities that share columns. When I try to configure the join column, I get the error: Repeated column in mapping for entity: Aula column: no_entity (should be mapped with insert="...
0
votes
1
answer
38
views
Oracle's row_number() paging efficiency is low in hibernate6 [closed]
In Hibernate 6, Oracle used row_number() for paging, but I found that its efficiency is not as good as rownum when the data is large. The field 'order by' has been indexed.
200w data takes ...
-2
votes
1
answer
61
views
Issue with Oracle Macro-Function and JPA/Hibernate: Why Does It Trigger an Exception with Valid Values?
I'm working with Java Spring Boot, JPA, and Hibernate to execute an Oracle SQL function, and I've encountered an unexpected behavior. The function is designed to accept a parameter and return it. ...
2
votes
0
answers
48
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 ...
0
votes
1
answer
34
views
Filter db entries with empty string
I'm using Hibernate 6, Oracle DB, Postgresql DB.
I need to get entries from table where "description" (nvarchar(255)) column is empty.
I know Oracle does not know empty string, it stores it ...
1
vote
0
answers
330
views
Why Hibernate 6.X creates HTE_ temporary tables when allocationSize is greater then 1?
I am updating my application, that uses Oracle database, from Spring Boot 2.7 to Spring Boot 3.3. In my entities, I have several @SequenceGenerator specified as the following:
@Id
@...
0
votes
1
answer
94
views
Migrating from spring boot 3.0 to 3.2 is causing issues with inserting objects into Oracle database
Recently, we migrated from Spring Boot 3.0 to 3.2 and lost our ability to insert an object into the Oracle database. The following is the object in contention:
@Entity
@Table(schema="S1", ...
0
votes
1
answer
59
views
How to use both group by and order by with criteria builder
I have a train service application
I have a class called Booking, it also has Product as a list on it.
Product has TrainBooking and TrainBooking has TrainJourney as a list on it.
I use the criteria ...
-1
votes
1
answer
42
views
Generate non-id value from sequence
I have an entity with two fields which both use the same sequence, but when debugging I see that only the id field value is being generated:
@Table(name = "MY_TABLE")
public class MyEntity {
...
0
votes
1
answer
39
views
How to Handle Indexes for @MapsId in JPA: Should FK and PK Share the Same Index?
I am using the @MapsId annotation in JPA to map a foreign key (FK) to a primary key (PK). According to the @MapsId annotation, the FK and PK share the same value. However, when I checked the database ...
0
votes
0
answers
92
views
JPA @Procedure multiple out parameters
Here is my working code:
public interface CandidatRepository extends JpaRepository<Candidat, String> {
@Procedure(procedureName = "garnuche.INSCRIPTION_TEST")
...
1
vote
1
answer
207
views
Ordinal enum mapping with Hibernate 6.5
I'm upgrading Hibernate from 6.1.7 to 6.5.2, there are many enum columns in my entities marked with
@Enumerated(EnumType.ORDINAL). My codebase has to run against both Oracle and SQL Server.
The ...
0
votes
0
answers
32
views
How to find out which column is failing if type is number and it exceeds the length in JPA insert operation
I am trying to insert a record in a Oracle 11g table which have around 100 columns.
repository.saveAndFlush(nextObj);
When i am inserting JPA is throwing exception like below, it not telling me ...
1
vote
2
answers
111
views
ORA-00997 illegal use of Long datatype while selecting data with Spring Data JPA
I recently updated an application to SpringBoot 3.2 with Hibernate 6 and encountered and issue selecting data by using repository.findById() out of an Oracle database with column type LONG RAW ...
0
votes
0
answers
76
views
Map Oracle JSON columns using JPA and Hibernate, ignore if value is null
@Type(type = "io.hypersistence.utils.hibernate.type.json.JsonType") @Column(name="Emp") private String Emp;
Error while execute empRepo.save(empEnity) (Emp is null)
SQL Error: ...
1
vote
0
answers
48
views
Hibernate session.get for String to Oracle CHAR query fails due to padding
We've Oracle DB which stores the data column using CHAR data type. Hibernate entity of the same has been mapped to java.lang.String.
Java 8
Hibernate 5.6.15
Oracle Database 19c
DB
"ACCOUNT_NO&...
1
vote
1
answer
35
views
Hibernate problem in Oracle handling edge Double values
I'm testing the handling of basic Java values with Hibernate and Oracle. I have an Oracle table with a binary_double column, and I want to insert from Java the value Double.MAX_VALUE, which happens to ...
0
votes
0
answers
18
views
Spring data native with project get a proxy result
I use spring data jpa, for one query, i use native query
public interface EditorDto {
Long getEditorId();
String getName();
}
@Query(value = """
select e1_0.editor_Id ...
-1
votes
1
answer
57
views
Hibernate ConstraintViolationException on SELECT query because of cached INSERT statement
I have this Hibernate select query that gives me a ConstraintViolationException.
Method:
public RfaSchoolWorkflow findViaCasePrepForm(CasePrepForm model) {
TypedQuery<RfaSchoolWorkflow> ...
0
votes
1
answer
250
views
Can't launch my Spring Boot App after adding some database options
I started getting this error after trying to connect my Spring Boot application to an Oracle DB. This was running completely fine before and I could bring up my main page and navigate between pages ...
1
vote
2
answers
402
views
Spring Boot with Oracle Sequence - 2 different applications get colliding SEQUENCE.NEXTVAL causing ORA-0001 unique constraint violation on primary key
I have 2 applications (one is SpringBoot app and another is a C++ app) calling the same Oracle sequence SEQUENCE_A responsible for generating PK on the same table TABLE-A.
The sequence DDL is as:
...
0
votes
1
answer
76
views
Hibernate with Oracle and database-links
For a monitoring solution, I need to connect to a oracle database, that has multiple database links. For simplifiaction I call them master and nodes.
In Oracle, you can define a database-link within a ...
0
votes
0
answers
25
views
Pass sequence name as parameter in @Query JPA Oracle [duplicate]
I am trying to retrieve data from Oracle Sequence using JPA as below:
@Repository
public interface SequenceRepository extends JpaRepository<MyEntity, Long> {
@Query(value = "SELECT ...
0
votes
0
answers
41
views
Spring Boot - BigInteger value in the response body is not correct
I have a field "old" with the data type BigInteger in Spring Boot.
Property in Entity:
@Column(name = "old")
private java.math.BigInteger old;
In the database, this field "...
0
votes
1
answer
83
views
Get value from another Oracle sequence if one sequence has reached its max value
I have a oracle sequence named SEQ_A ranging from 1 to 100.
I want to handle my JPA code in such a way that if range in SEQ_A has reached max number than the application should read from SEQ_B and if ...
0
votes
1
answer
191
views
Hibernate 6 Entity Error - Unable to determine JavaType to use : BasicValue([Column(ID)])
// Entity
@Id
private Long id;
In Oracle Database, column ID is of type NUMBER
I'm getting this error when I try to boot up my Spring Boot application Unable to determine JavaType to use : BasicValue(...
0
votes
2
answers
366
views
How to get nextval of dynamic sequence
I have tried to optimize my code and use a shared method for the cases where I need to get sequence nextval for multiple sequences in my application.
But when I tried to do it as clean and safe as ...
0
votes
0
answers
37
views
Upgrading from Hibernate 4.x to 5.x producing SQLException Invalid Column Index
Currently my application is having Hibernate 4.x. Since Spring 5.x requires Hibernate 5.2 or later, I am trying to upgrade it to 5.2.6.Final
ivy.xml
<dependency org="org.springframework" ...
0
votes
0
answers
59
views
{h-schema} is not taking the default schema while calling the procedure using @Procedure()
{h-schema} is not taking the default schema while calling the procedure using @Procedure() .
boostrap.yml
spring:
jpa:
properties:
hibernate:
proc:
...
0
votes
0
answers
49
views
Select data from 2 Data Bases without DB Link
I'm trying to read data form 2 different Data Bases but I'm not allowed to use DB Links,
is there another way to achieve this?
I merged 2 results in a Java List but it doesn't work when i use group by ...
2
votes
1
answer
4k
views
Transaction silently rolled back because it has been marked as rollback-only(on one environment)
In an application of ours,during an operation I am getting this error "Transaction silently rolled back because it has been marked as rollback-only"
In the logs i can see this-
2024-01-05 ...
1
vote
1
answer
266
views
Old hibernate hilogenerator to @TableGenerator use different start id's
I'm migrating a spring boot 2 application to spring boot 2
In the old application I have a MultipleHiLoPerTableGenerator (SB2, J11). This one is removed. I migrated to the @TableGenerator .
@...
0
votes
1
answer
138
views
Hibernate org.hibernate.TransientObjectException: object references an unsaved transient instance
I searched above error message and found several questions related to, like Object references an unsaved transient instance save the transient instance before flushing error and object references an ...
0
votes
1
answer
161
views
Numeric overflow exception in spring boot JPA - Hibernate
I have the following error:
Caused by: java.sql.SQLException: Desbordamiento Numérico
at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:4139)
at oracle.jdbc.driver....
1
vote
1
answer
333
views
Oracle Connnection issue in Hibernate Reactive
I tried to use oracle as db in my hibernate reactive example, but I can not make the connection working well against localhost.
I have tried the following approaches to set up oracle database in the ...
1
vote
0
answers
82
views
Attempt to access a global temporary table already in use
I'm trying to insert data to a global temporary table in Oracle from my application using Hibernate session. This data will then be used by a DB procedure called from the same application.
The global ...
-1
votes
1
answer
94
views
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement with oracle
I am got this exception when I run my MVC project with Hibernate inserting the view data into a database. How do I solve this exception and how to insert the data into an Oracle database?
...
-1
votes
1
answer
302
views
Why the ID value is not auto-generated with IDENTITY in the Oracle database?
Oracle database is used in the SpringBoot project of a company I work for. There is no problem while the project is running, but when the save() command runs, it gives an error because it cannot ...
0
votes
1
answer
185
views
JPA Bind Parameter in Literal Value
I need to use Oracle JSON_TRANSFORM function in my Spring Boot app to update a single field in my complex JSON which containing huge amount of JSON fields and arrays. Here's a snippet of the native ...
0
votes
0
answers
55
views
ORA-00979 not a group by expression Error in JPA Query with Hibernate
I am experiencing an issue while trying to create a daily process to generate statistics for my application. I successfully created an initial approach that works for pulling today's statistics:
@...
0
votes
1
answer
659
views
Object value not saving to the database through Hibernate
I am working on a Spring Boot project that uses Hibernate to interact with an Oracle database.
The save functionality isn't working as expected. It is just the default implementation from the Spring ...