Y
Y
Yasuro2019-12-29 14:42:55
JavaScript
Yasuro, 2019-12-29 14:42:55

What to read about application transaction?

There is a heavy business object which now I save through services. By a business object, I mean an entity that stores records from different database tables, for example, a movie: the title is in the "movies" table, the author is in the "user" table, likes are in the "likes" table. All together it is a business object.
Now, in order to modify or save it, I call the service, to the input of which I send this object.
It would be desirable that at the beginning of the application execution a transaction was opened, an object was raised, modified, and before sending this case to ui, the transaction was closed and the object was committed to the database without an explicit call to the service.
It is clear that you can make an abstract class, but is there something more professional for such purposes?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Loginov, 2019-03-01
@woodyJS

Track changes through the input event, and change the desired input. Here is a working example.

V
Vladimir Proskurin, 2019-03-01
@Vlad_IT

Listen to the oninput event of the slider, and when it fires, take its value and throw it into the input. In the same way, you listen to oninput at the input, and when it fires, you throw its value into the slider.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question