-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SML is updated from even if we get a database error #71
Comments
Hi Emil, |
Thanks! |
And you are using PEPPOL or OASIS BDXR API? (makes a difference in the writable REST API as well) |
I think I found a suspicious piece of code. There it would be helpful if you could tell what exception you retrieved.... thx |
I am using com.helger.peppol.smpclient.SMPClient so I guess it is Peppol? Is it advisable to use this class when using the SMP REST apis? I stumbled upon it and thought it looked nice! This class itself does not report any error but looking into the logs of the SMP it goes like this: First try (when the database error occured): (sorry I update the first stack trace since I took the wrong one) at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:159) ~[org.eclipse.persistence.jpa-2.7.1.jar:?] Second try when the SML was already updated: [2018-04-03T09:34:02,077] [SMP-SERVER] [ERROR] [http-bio-80-exec-11] Could not create business iso6523-actorid-upis::0007:5561244962 in SML -- com.helger.peppol.smpserver.smlhook.RegistrationHookWriteToSML.createServiceGroup(RegistrationHookWriteToSML.java:161) |
You seem to refer to two different SMPs :) The first log uses SMP 5.0.5, the second log use SMP 5.0.3 - I'm confused.... That the creation fails, if it is already in the SML (2nd callstack) is fully okay Anyway I think I found the issue. Are you able to test SNAPSHOT versions, or do you need to wait for release versions? |
I'm very sorry, I searched for the error and got an old log - I see that now! And I totally agree, the second error is ok since the service group is in the SML. I can test on whatever I can pull from github! Another thing I noticed was that neither the SML error nor the database error was reported back to the SMLClient which would have been nice I believe? |
So I think I fixed the error (it was btw. the same in deletion). To fix this issue I suggest the following:
Please use at least SNAPSHOT "-6" from https://oss.sonatype.org/content/repositories/snapshots/com/helger/peppol-smp-server-webapp-sql/5.0.6-SNAPSHOT/ for testing. Thanks |
Thanks Philip, Ok, so I have installed peppol-smp-server-webapp-sql-5.0.6-20180420.155214-6.war and my first test is to add a new participant using the REST API. I now get another problem - the participant is created in the SMP but not updated in the SML. I get an error in the log that I have gotten before as well, at some points, but maybe after your changes this is what causes the SML to not being updated? This is just a wild guess since I think it should have been updated since I get the participant in the SMP. Anyway this is the only error in the log so I paste it here - and the line after the stacktrace says Finished saveServiceGroup so I believe that the SML should have been updated.
Thanks for assisting |
This is an "information exception" only. This message is just to inform you, that the SQL expression took very long (5,6 seconds). I assume you want to disable it or change the time limit? |
That would be nice! How do I do that? |
The default warning time is 1 sec. Do you want to disable it, or do you want to enlengthen the time period? |
Enlengthen if possible! |
takes some time because of some basic lib changes (I want to be able to turn it off as well). I will post here when the new SNAPSHOT with the new config parameters is available! Thx again for your input! |
Thanks Philip! I now have reverted to my database issue, to see how it works. I see in the logs that the SML is updated (creation of service group) and then deleted again. I cannot find the participant in the SML afterwards so that seems fine. In my opinion the database of the SMP perhaps should be updated before calling the SML but I have limitied knowledge here..? Nevertheless, if I run again on the same participant, I get SML-unauthorized error. So it seems to be not completely deleted? Or is this a delay-issue? EDIT: another test got through so I assume this is perhaps a DNS-delay problem and nothing to focus on |
As I am testing different scenarios I would like to bring up another question. Could errors like a) internal SMP database errors b) SML-update errors be reported back to the client when trying to update SMP/SML using the REST api? Otherwise I have no way of knowing if the update actually came through or not. I'm using com.helger.peppol.smpclient.SMPClient (method saveServiceGroup for example) against my own SMP. Or would I be better off using the BDXR-client? Thanks again, |
I'll try to answer all questions in order:
|
Thank you for your answers Philip. I understand your point regarding SML/SMP order! I will create another issue for error propagation to REST clients. And my tests regarding database errors showed that your fix for this original issue is working. Thanks again! |
Thanks for testing and for the new issue. SNAPSHOT 9 and later from https://oss.sonatype.org/content/repositories/snapshots/com/helger/peppol-smp-server-webapp-sql/5.0.6-SNAPSHOT/ do the trick. |
Greetings Philip!
I just tried using the REST api for adding a service group (using SMPClient.saveServiceGroup) and got a database error so the service group was not added to the SMP database. I'm running the database on iSeries DB2 so I will look into that error myself. But I noticed that the SML is updated anyway and my thought would be that the SML should not be updated in case of database errors. What do you think?
Regards Emil Bokenstrand
The text was updated successfully, but these errors were encountered: