• Update and Delete always Failed

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #46542  by mamad
 
hi guys
i want to update and delete some data from database in a gwt-based class according to code below :
(i copy and paste all codes from documentations)
Code: Select all
 // Update value
        security.setName("some name changed");
        metadataService.updateValue(security.restoreToMap(), new AsyncCallback<Object>() {
            @Override
            public void onSuccess(Object result) {
            }
            @Override
            public void onFailure(Throwable caught) {
            }
        });
 
        // Delete value
        metadataService.deleteValue(security.restoreToMap(), new AsyncCallback<Object>() {
            @Override
            public void onSuccess(Object result) {
            }
            @Override
            public void onFailure(Throwable caught) {
            }
        });
    }
Problem is that always onFailure method calls(i initialize tables correctly before ) and nothing delete or update from database.
why is this for ?
thanks in advance
 #46547  by jllort
 
Seems you are modifying the source code, no? Are you using the OpenKM development environment for it. Anyway, first step is to check if your code really is executed. I suggest some breakpoint at the Servlet side and some Window.alert("test") from GWT side to ensure really the code is executed.
 #46550  by mamad
 
yeah im modifying source code and also using ova and my code execute well (i use an alert in OnFailure() method and this alert always appear when i try to update a row of table)
i just copy and paste all codes from documentations (even queries for initialize database) from link below.
https://docs.openkm.com/kcenter/view/ok ... gwt-).html
Insert and Select codes works properly but Delete and Update always failed.
Are you sure you test delete and update parts of your codes ???
 #46559  by jllort
 
You might debug in what conditions arrive data in the servlet and how comes into until is executed. When you are talking about an error, do you refer to the data is not removed from the database or is raised some exception?
 #46566  by mamad
 
I mean data is not removed or updated in database and it does not throw any exception.

Actually onFailure() method always called when i try to update or delete.

Please consider that i am talking about the pure source code in documentation (i don't change any line of that and just add a window.alert() to onFailure method to ensure it call every time i try to update or delete)

Also i initialize database(OKM_DB_METADATA_TYPE and OKM_DB_METADATA_VALUE tables) by executing queries in documentations.

Do you test the update and delete methods yourself to ensure they works properly ???
 #46586  by jllort
 
If you suspect the code is wrong, you should debug it and report the bug. The code was working an tested when was created. These sections of code come from professional version and we do not longer use it, really in the professional version we consider as deprecated and moved to a more specific solution when needed to work with custom tables rather than using these based on metadata.

Anyway should be working, an in case they are not working you should follow the code in order to discover if the method is doing what expected or not, at the end each method ends with SQL query to be executed, if the query is not right then should consider if it's an error with the code of how are you using it or how tables are registered.
 #46859  by jllort
 
We will take note about it, I supposed "safe mode" only affected Work Bench connection, not the other database connection.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.