cancel
Showing results for 
Search instead for 
Did you mean: 

FlexibleSearch Commit / Rollback in HAC

Former Member
0 Kudos

This was asked in the old forum as well, but never answered.

What does the Rollback / Commit function do in HAC FlexibleSearch? I seem to get the same results either way.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Volodymyr and Tomasz for your answers. It makes sense that the "rollback" feature should be there in the case of direct SQL queries. I did a bit of research on when it might make sense to use this with SELECT queries. I'm posting this in case anybody else finds it useful.

This is how the mechanism works at the database level:

Rollback

  • autoCommit = false

  • run query

  • rollback

Commit

  • autoCommit = true

  • run query

  • (commit)

Ilmar Kerm explains "A little side-effect of having autocommit off in MySQL":

The default transaction level for MySQL InnoDB is REPEATABLE READ (unlike Oracle, that has READ COMMITTED as default), that means that the SELECT query always returns the data at the time point when the transaction was started. If autocommit is off, then the first issued select statement will open the transaction and any subsequent select statement will return the data at the time point when the first select was issued, until transaction is ended with COMMIT/ROLLBACK. If autocommit is enabled, SELECT statement is run in a self-contained transaction, ending with COMMIT, so the end result is like READ COMMITTED isolation level in Oracle.

former_member437308
Active Participant
0 Kudos

Hi,

Good notice, this option is unnecessary on FlexibleSearch tab and doesn't change anything during search query execution. I think that this option should be disable.

Commit/Rollback only makes sense on SQL Query tab where you can write UPDATE/DELETE/INSERT query.

You can disable this in file /platform/ext/hac/web/webroot/WEB-INF/jsp/console/flexsearch.jsp by comment div tag in :

                             <!-- <div class="onoffswitch-large" style="float:left;margin-top:7px">
                                 <input type="checkbox" class="onoffswitch-checkbox" id="commitCheckbox1"/>
                                 <label class="onoffswitch-label" for="commitCheckbox1">
                                     <div class="onoffswitch-inner" _on="COMMIT" _off="ROLLBACK"></div>
                                     <div class="onoffswitch-switch-large"></div>
                                 </label>


Cheers!

Former Member
0 Kudos

Hi Jim,

As Vinay said (in an answer he has removed 🙂 ) it determines whether your changes will affect database.

As you can see there's a tab SQL Query next to Flexible Query in FlexibleSearch page where we can execute raw SQL queries including ones that update db. So if you set Rollback then all your changes will be rolled back.

I've noticed one interesting thing that in Commit mode changes in db are reflected immediately, but in hmc (I suppose everywhere else as well in hybris) you won't see changes unless you run Update (you can run it without any options checked). Apparently changes made by direct SQL queries are performed omitting hybris cache which need to be updated accordingly.