The following example explains my problem, Iknow its not normal to do what you see on this method, this is only for the exmple.
databaseManager.startTransaction();
controller.newRecord();
dataprovider = 'test';
var query = "select dataprovider from tableA where dataprovider = 'test'"
var dataset = databaseManager.getDataSetByQuery('server', query, null, 100);
databaseManager.commitTransaction();
The problem is that when the query is launched, Servoy makes a NEW transaccion to the database, so the result is null because the data is not jet in the databae.
Servoy should use the same transaccion for everything that you do inside a startTransaction and commitTransaction
What can I do ???..I need to do everything inside, some times its no easy to search with servoy directly, it better with pure selects; mostly if you are serching with a lot of relationships with lots of tables.
If you do the following you are still inside the transaction.
databaseManager.startTransaction();
controller.newRecord();
dataprovider = 'test';
controller.saveData();
var query = "select dataprovider from tableA where dataprovider = 'test'"
var dataset = databaseManager.getDataSetByQuery('server', query, null, 100);
databaseManager.commitTransaction();
All you are doing is telling Servoy to write it’s cache back to the database. The database is keeping track of the transaction anyway … not Servoy. So you can always rollback.
(ofcourse not after you already have committed it, but that speaks for itself.)