Questions tagged [optimistic]

34 questions
1
vote
0 answers

optimistic update for like/dislike and like count with react native, redux

I am building simple video with like/dislike capability like this but its not working properly when like or dislike rejected because in componentDidUpdate its going to loop and I dont know what condition should I use to prevent from that. This is…
bekkan
  • 21
  • 4
1
vote
1 answer

Does hibernate a default optimistic locking for detached objects?

I have an application that does: void deleteObj(id){ MyObj obj = getObjById(id); if (obj == null) { throw new CustomException("doesn't exists"); } em.remove(obj);//em is a javax.persistence.EntityManager } I haven't…
Dani Cricco
  • 8,829
  • 8
  • 31
  • 35
1
vote
1 answer

JPA optimistic lock with SQLServer TIMESTAMP

I am trying to setup JPA optimistic lock on SQLServer. For that purpose I use a TIMESTAMP column (SQLServer TIMESTAMP is an incrementing number and does not preserve a date or a time). Being an auto-incrementing number, on my Java entity I need to…
1
vote
1 answer

What is the pattern for optimistically adding list items in web app?

We are creating an React application, which has lists with basic CRUD operations in multiple places. The basic example, of course is: Fill input to have name for the item, click submit Send request to server Fire callback on success Update list…
Jaakko Karhu
  • 2,298
  • 4
  • 28
  • 41
1
vote
3 answers

play 2.4 ebean update optimistic locking

I am trying to implement crud sort of like computer-database example using play 2.4 with ebeans. Everything works except update. When I run the computer-database example against same MariaDB and older ebeans (3.2.2), it does update just fine so…
Slayer6
  • 121
  • 6
1
vote
1 answer

How does Meteor handle dependent failed optimistics operations?

How does Meteor's optimistic UI handle server rejections and errors on dependent operations? If I do : var item1Id = Items.insert({list: groceriesId, name: "Watercress"}); // op1 var item = Items.findOne({_id: item1Id}); Items.update(item, {$set:…
opsb
  • 29,325
  • 19
  • 89
  • 99
1
vote
1 answer

Is it better to handle MessagingEntityNotFoundException or should i check for Topic existance before sending message

In the code sample in documentation for Microsoft ServiceBus following code is used to make sure that the topic exists. // Create the topic if it does not exist already string connectionString =…
Ammar
  • 233
  • 1
  • 8
0
votes
1 answer

Solving Nhibernate concurrency issues

I am currently thinking about implementing an application with NHibernate and I would like to be able to solve concurrency issues by showing the user which fields have changed since he retrieved the instance. So the user should have the possibility…
Eggi
  • 1,684
  • 4
  • 20
  • 31
0
votes
2 answers

Django form update optimistic locking, version based

I've got django model and view implemented like here: (+mysql db) class MyModel(models.Model): name = models.CharField(max_length=100) version = models.IntegerField(default=1, editable=False) def updateModel(request, id): toUpdate =…
andrew
  • 11
  • 3
0
votes
1 answer

Optimistic Locking in Rails not allowing record to be modified in the console

I'm working on the database locking to ensure the safe data transactions in a multi-user participation. The machine is installed with Passenger. After I added the 'lock_version'(integer), the record no long is able to be modified through console.…
Sungpah Lee
  • 1,003
  • 1
  • 13
  • 31
0
votes
0 answers

Can a optimistic lock give a deadlock?

Example: i have a table A (id, version and a field) and a table B (id, version and a field). i need to make a transaction that edit a record A, and then a record B. begin transaction update tableA set field='aaa', version=version+1 where id=1 and…
0
votes
0 answers

Apollo - Using optimisticResponse for dates

I'm trying to setup an optimisticResponse with a date column using react-apollo. My code is not properly returning the optimistic response data and rerendering my component accordingly. I'm assuming it's because I don't have the exact date that's…
Grant
  • 121
  • 5
0
votes
0 answers

Apollo Cache - Partially read from cache?

I'm trying to achieve optimistic updates with apollo client. I already have it working in different places in the app however I'm facing a wall here. I'm running store.writeQuery({query, variables, data}); within the update mutation callback and…
gomes
  • 681
  • 1
  • 7
  • 20
0
votes
1 answer

Is this a good first project for my low Java skill? *Age Detector*

I am Andrew, I just started learning Java and made a code. It took me about two hour but it works well. It basically allows you to input your gender, and then your age, it then tells you if you are old or not, with a bunch of different set messages.…
0
votes
1 answer

Do optimistic locks work for multiple applications

Multiple servers use the same database,when they access the same data by optimistic locks.Sever A,server B get the data of version 1,and they commit at the same time with the version 2. Do optimistic locks work for multiple applications?
jr1990
  • 1
  • 1