Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

HSQLDB not null restriction errors #7

Open
halfabrain opened this issue Aug 9, 2016 · 5 comments
Open

HSQLDB not null restriction errors #7

halfabrain opened this issue Aug 9, 2016 · 5 comments

Comments

@halfabrain
Copy link

Hi Jirkapinkas,

Just tried to work with the tool with HSQLDB, but the following error is hitting me, when I try to add a site:

12:13:56,007 ERROR SqlExceptionHelper:146 - integrity constraint violation: NOT NULL check constraint; SYS_CT_10126 table: MONIT_CHECK column: CHART_PERIOD_TYPE

I removed the "not null" from the script or text file for this table. And then I get it to work. But I don't know if this is the correct way to fix this.

Please advise/help me

Regards
Ronald

@jirkapinkas
Copy link
Owner

Thanks for your bug report. I ran into similar bug occasionally as well. For now your quick fix is good enough, I guess. I will investigate more. Unfortunatelly right now I have too much work, so it will take a while ...

@ckevinhill
Copy link

Problem still exists.... halfabrain, what script did you edit?

@FantailIO
Copy link

I think this is caused by polling for results - the CheckController.updateResults method causes loadChecks to run, which clears the current check. If you remove this "clearCheck" call the save works. I have a PR if you like, am working on adding a Slack integration.

+++ b/src/main/java/net/sf/sitemonitoring/controller/CheckController.java
@@ -107,11 +107,11 @@ public class CheckController implements Serializable {
        public void loadChecksForPage(Integer pageId) {
                this.pageId = pageId;
                loadChecks();
+              clearCheck();
        }
 
        public void loadChecks() {
                checks = checkService.findByPageId(pageId);
-               clearCheck();
        }
 
        public void updateResults() {
@@ -217,11 +217,13 @@ public class CheckController implements Serializable {
        public void delete(int id) {
                checkService.delete(id);
                loadChecks();
+              clearCheck();
        }
        
        public void deleteAll() {
                checkService.deleteAll();
                loadChecks();
+             clearCheck();
        }
 
        public void addCredentials() {```

@vghero
Copy link

vghero commented Feb 11, 2019

Same here.

@IssaBa
Copy link

IssaBa commented May 20, 2020

Hello ,
I had the same problem but I solved the problem at the level of my class by saying to hibenrate listen to me generate the id automatically.
Code :

 @Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants