Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cargotracker-dev] Initial-data.sql potential modification

To be honest, I prefer to see if adding Open Liberty support really makes sense overall before making too many changes.

This too seems like an ugly workaround to get around a bug or serious limitation. H2 is far more capable/actively developed as compared with Derby (http://www.h2database.com/html/performance.html), at least in part because of the fact that Spring Boot promoted it pretty heavily. It's part of the reason the Payara folks moved away from Derby.

What is the issue with Open Liberty and H2? Have you tried another embedded database: https://www.baeldung.com/java-in-memory-databases? Is there a way to get things to work reasonably portably without code that looks like a workaround?

On 6/8/22 12:34 PM, Chanun Ong wrote:
Hi Reza,

Thanks for your input about the SSE issue. I'll keep in correspondence with the Open Liberty folks and hopefully we can identify the problem and apply a fix to the runtime. On an unrelated note, I was wondering about modifying the initial-data.sql statement to work with Derby as the modification I've been using has also worked on the Payara implementation. 

For reference, the statement in the original project is: 

"INSERT INTO applicationsettings (id, sampleloaded) VALUES (1, FALSE);"

Since Derby doesn't support the int-boolean pairing and H2 has encountered compatibility issues with OL, the workaround I've been using is:

"INSERT INTO applicationsettings (select 1 as id, 0 as sampleloaded from applicationsettings where id = 1 having count(*)=0)"


This eliminates the type problem that Derby encounters as it removes the need to insert the "FALSE" boolean value, and I was wondering if it would be good to merge in as this statement is also compatible with Payara. 


Let me know what you think. 


Best,

Chanun Ong
University of California, Berkeley
Electrical Engineering & Computer Science, B.S. 
Class of 2022

Back to the top