Questions tagged [id-generation]

81 questions
1
vote
1 answer

Concurrency issue in Databricks Delta lake

I have an audit table in Databricks Delta Lake with four fields: id, task_name, start_time, and end_time. The purpose of this table is to capture the start and end times of each job. However, I am currently facing concurrency issues when running…
1
vote
1 answer

Is this a correct solution to the Spring Data JDBC problem of the insert/update?

PROBLEM: when I tried to create a new entity 'Customer' with Spring Data JDBC (in a Spring-boot application) @Data public class Customer { @Id private String identifier; private String name; } Using a…
1
vote
1 answer

ID Generation by Sequence On Oracle Golden Gate

On my Oracle 19c Golden Gate cluster, two instances on different geographical locations run at the same time. (active-active) In my application code, I need to generate ID, for which I prefer to use Oracle Sequence (nextval function). Oracle golden…
Ahmet Altun
  • 3,910
  • 9
  • 39
  • 64
1
vote
1 answer

How to manually set a value for @GeneratedValue

Have a Spring boot with Spring Data JPA. Postgres DB. General entity: @Entity @Table class Entity { @Id @GeneratedValue private int id; } when I try to make an entry with a specified id value, as a result I see that it is ignored and generated…
Draaksward
  • 759
  • 7
  • 32
1
vote
1 answer

Spring JPA - sequence caching gives unexpected behaviour. Using allocation size = 1 is ok

My Spring Boot application uses a.o. 2 Entity classes. Entity class 1 uses a technical key id that uses a sequence. The Entity contains a list of other Entities, so a one-to-many. The Child entity uses the same sequence. Using a seqeuence…
user10389661
1
vote
1 answer

DataRetrievalFailureException thrown when persisting entity with a non auto-increment id on Oracle database

I use Spring Data JDBC with an Oracle database and I set a custom id on my entity with a BeforeSaveEvent processor. @Bean public DataFieldMaxValueIncrementer incrementer() { OracleSequenceMaxValueIncrementer incrementer = new…
1
vote
1 answer

String ID Primary Key generator in JPA/Hibernate

I know that we can generate a random UUID - @Id @GeneratedValue(generator="system-uuid") @GenericGenerator(name="system-uuid", strategy = "uuid") private String myId; But UUID is a String if size 32. How can i generate a random alphanumeric string…
Prateek Narendra
  • 1,837
  • 5
  • 38
  • 67
1
vote
1 answer

transaction isolation level: set table isolation level differently

If I set transaction isolation level to READ_COMMITTED, can I set a table isolation level differently such as READ_UNCOMMITTED? The reason for this is that the changes to a table need to be visible immediately to other transactions. Transaction:…
eastwater
  • 4,624
  • 9
  • 49
  • 118
1
vote
2 answers

Hibernate/JPA mixing ID generation strategies

Suppose I have the following situation: I have 5 entities (reduced for the sake of simplicity) of which I unequivocally know that 3 of them will have few records in the database (15-20 or so each). The remaining 2 entities will have a lot of records…
tmbrggmn
  • 8,680
  • 10
  • 35
  • 44
1
vote
0 answers

What is the default ID generation strategy in Grails (GORM) for Databases that do not have native auto-increment capability

I am using grails 2.4 with oracle. Right now if i want to create a row in database table, i simply create a domain object in grails and invoke save() method. I do not currently pass any id into that object though. new State("MN",…
Karthik Cherala
  • 312
  • 4
  • 10
1
vote
1 answer

Spring-Boot with JPA don`t keep Id

I Need to insert one record in my DB, but in some cases I need to pass the ID but when I insert my id manually the spring-boot don`t save with this ID, the spring-boot got a new from sequence this is my Entity @Entity @Table(schema =…
Fabio Ebner
  • 2,613
  • 16
  • 50
  • 77
1
vote
2 answers

Hibernate: generate different (unique) IDs for same object reference in a list

Question Is it possible to do an insertion in Hibernate when there is the same object reference twice in a list, I want to insert both of them and the ID has to be unique? Background I'm using random-beans to generate a random object Person which…
Marvin
  • 9,164
  • 3
  • 26
  • 44
1
vote
1 answer

Defining the default id type for all domain classes

In a mongo-only setup we need to use a String id (or ObjectId): class SomeDomain { String id /// } in all domain classes of the app. Is there a config shortcut to set the default String id overriding GORM's default Long id for all domain…
injecteer
  • 20,038
  • 4
  • 45
  • 89
1
vote
1 answer

Hibernate: Table generator inserting negative primary keys in table

I am using Table Generator strategy for generating primary keys. Recently I upgraded to Hibernate 5 and i am getting issue of primary keys getting generated negative values. Database: PostgreSQL 9.3, Hibernate 5.0.2 Here are my annotations look…
Milan Pandey
  • 1,010
  • 10
  • 22
1
vote
1 answer

Custom ID generation with OrmLite

I'm working on an Android App that has it's own way to generate unique identifiers for entities. Before every entity creation we assign a new ID for our objects. We're currently doing something like…
jairocgr
  • 11
  • 1