adgadev
Re:Show HN: A library for finding origin and context of JPA issued SQL...
on Friday December 04, 2020 @11:42AM (#25304412)
Yes, currently jplusone requires Spring & Spring Boot to work, mainly because it significantly reduces effort needed to integrate the library into applications (adding dependency and enabling logger by developer is enough in most cases, the rest is handled by spring boot autoconfiguration), and minimizes the risk of wrong setup. I think with some minor changes it would be possible to allow using jplusone without spring. I'll try to add such option in future releases. Thank you for a good idea for an improvement.
Re:Show HN: A library for finding origin and context of JPA issued SQL...
on Friday December 04, 2020 @09:51AM (#25302803)
ObjectiveSQL seems like another ORM framework for Java,
alternative to JPA. From my experience JPA and its implementors (Hibernate) are much more popular and more widely used in projects.
Currently JPlusOne can be applied only to projects using JPA, but adding support for ObjectiveSQL may be good idea for next feature. Thanks
Re:Show HN: A library for finding origin and context of JPA issued SQL...
on Friday December 04, 2020 @09:40AM (#25302679)
Correct, JPA stands for 'Java Persistence API'
Re:Show HN: A library for finding origin and context of JPA issued SQL...
on Friday December 04, 2020 @09:38AM (#25302652)
Yes, it should work with any JVM based language (java / kolin / groovy / scala / etc) as long as they uses JDK9 or higher
Finding origin and context of JPA issued SQL statements made easy
Re:Show HN: A library for finding origin and context of JPA issued SQL...
on Thursday December 03, 2020 @07:46AM (#25288314)
Creator here. As a developer, while working on performance optimisations on microservice with complex domain modeled in JPA, I struggled a lot with investigating why there are
dozens of various SQL triggered by each service call, and what exact place in code is responsible for triggering them. I needed those information to choose and apply optimisation strategy i.e. detect N+1 SELECT problem and extend other query with one more JOIN. It was cumbersome task since there was no easy way to do that, only SQL logs generated by Hibernate with no context, just timestamps. Moreover each new feature can silently break those optimisations.
That's why I decided to write JPlusOne open surce library which would help with easy finding origin and context of JPA issued SQL statements. JPlusOne can generate report for each integration test containing complete tree of JPA persistence related activity or just situations when i.e. lazy loading is occurring, potentially leading to N+1 SELECT problem. Moreover JPlusOne provides API which allows to write tests checking how effectively, from performance point of view, your application is using JPA in context of some business operation (i.e. assert amount of lazy loading operations, or SQL statements in general). I hope you find it useful. Any feedback will be appreciated. Thanks.