-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support Neo4j-OGM in the Neo4j extension #8530
Comments
/cc @michael-simons |
While there actually people using OGM in CDI scenarios, it would definitely not work in native mode. Thinks that would be needed: A class index (probably Yandex), replacement for the reflection based entity instantiation and a couple of other things. I’ll raise this in our team at least for discussion. |
Hi, |
As Michael beforementioned, you'd need to read from the Jandex index instead
Em Dom, 12 de abr de 2020 16:57, fiorenzo pizza <notifications@github.com>
escreveu:
… Hi,
some days ago, i started to play with neo4j-ogm. I have problems with
classloader in dev mode (mvn compile quarkus:dev - neo4j-ogm don't see the
java classes with @NodeEntity annotation). In test and in java mode
(running java -jar target/xxx.jar) quarkus and neo4j-ogm work correctly.
I would like to investigate if I can identify the classes to be
highlighted for reflection to have quarkus in native mode.
My test project: https://github.com/fiorenzino/neonq
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8530 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANG5O42RAUBLQCPJAD5KLRMIMLDANCNFSM4MFSMPQA>
.
|
HI @gastaldi
|
Huge +1 from me on this issue, having OGM would be nice. Managed to get Quarkus working with OGM (manually, with only |
Why not use Hibernate OGM instead? If you are familiar with Hibernate ORM and JPA, it is more friendly for developers. |
@hantsy We try to be as friendly as possible :) Not finding things in dev mode has luckily nothing todo with Graal Native: @sdaschner @fiorenzino Would you please raise this as an issue with @lukehutch from https://github.com/classgraph/classgraph/? It seems we're playing through all the class loaders out there. You can basically copy my reproducer from OpenLiberty from that issue: classgraph/classgraph#414 The guts of it being:
Just add a package with one empty class and see if it returns something |
@fiorenzino @michael-simons Updating Neo4J OGM to <!-- required for Neo4J 3.2.11, Quarkus imports 4.0.0 -->
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>4.0.1</version>
</dependency> @hantsy Seems that there is currently no plan to support Hibernate OGM: #6514 |
There's an open issue #6265 I can bump the version number there… |
The version is already upgraded. |
Correct, the Quarkus classloader is supported by ClassGraph, however ClassGraph cannot work with Quarkus in native mode, because there is no traditional classfile to read. However, there is some advice on the ClassGraph wiki on how to implement build-time scanning. Presumably the Neo4J-OGM plugin could do something like this, perhaps even in an automated way, to index classes, if the compiler is building a native project. (Is there any way to force GraalVM's partial evaluation to automatically turn run-time scanning directly into build-time scanning, by running the runtime scanning logic at build-time, and caching the result in the compiled binary? Maybe this is wishing for too much.)
Sorry, can you please describe the issue? |
OK: i can confirm, using latest version of neo4j libraries in quarkus 1.3.2.Final,
|
@fiorenzino @michael-simons There seems to be a new issue with OGM (in JVM) mode with Issue When I'm building a Quarkus app with Neo4J-OGM (
error again, when I'm using a recent Quarkus Changing to (Sorry to revive this old issue, made more sense to me than opening a new one) |
@sdaschner If you believe there is a ClassGraph issue, please capture the verbose logs by calling (Also, if you're running on JDK 16, there have been many issues already, for many libraries like ClassGraph, with the JDK team switching on strong encapsulation...) |
OGM just use Classgraph for discovering classes… I probably can't fix that. Btw related in general to this ticket is #18764 |
Thanks Michael, indeed, adding an index similar to yours solved this for the However, in that case I'd rather go with the Maybe someone else can comment on what might cause the issue with the Quarkus packaging modes? |
Just wanted to confirm @sdaschner's post - seems classloading is not working properly when using quarkus.package.type=fast-jar. (tested with various versions of Quarkus between 1.10.3.Final and 1.13.7.Final within a Docker container, Neo4j-OGM 3.2.24, OpenJDK1.8.0). |
Hi @AndreasBoehme @sdaschner it would be nice if you can try out Neo4j-OGM 3.2.26, it uses latest Classgraph and should work on JVM mode with both legacy and fast jar. Thanks. |
@michael-simons Finally could give it a try :) Can confirm, works well, thanks! |
@michael-simons finally had some time to test it - I can, too, confirm it works with fast-jar! Thank you! However, heads up others: key is the use of io.github.classgraph:classgraph:4.8.116, which is a transitive dependency of the mentioned org.neo4j:neo4j-ogm-core:3.2.26. I'm mentioning this, because I fixed the classgraph version in my parent to an older version, thus raising the same errors. |
Thank you so much @AndreasBoehme for your feedback! Anyway, yes, you need classgraph >= 4.8.116 for things to work. Also, Classgraph is moving quite fast, I think I have to bump both. Also (2): Neo4j-Migrations should be stable right now. I try to be strict with semver from 1.0.x onwards. |
Yes, it would be worth it to bump the required ClassGraph version, if you're depending upon 4.8.116. ClassGraph is converging on a bug rate of zero -- I have pushed out a lot of releases in the last few months, but almost all of them have been to fix tiny corner cases. I don't plan any other major features (other than that once the library totally stabilizes, and there have been no bug reports for many months, I'll push out a version 5.0 that will remove deprecated API and will bump the minimum supported JDK version from 7 to 8). |
Hey @lukehutch nice to see you. My remark was not meant as a critic. All updates the last months worked API wise (for us) as simple drop ins. 👍 |
@michael-simons I know -- no problem at all! Just wanted to provide some perspective on the stability of the project at this point. I don't think there will be many changes in the future other than small tweaks, as long as you're not using JDK 7 (do you have JDK 7 compatibility in your builds?), and as long as you're not using deprecated API. |
@AndreasBoehme Can you drop me line if you have time how you use https://github.com/michael-simons/neo4j-migrations in your Quarkus setup? I have been ruminating about adding a Quarkus plugin much like the Boot one in the project, but I do struggle to get it right for native so that users would not have to add much themselves apart from the necessary resources. My email is in the pom. |
Hello everyone. This is soon to be released: https://github.com/michael-simons/neo4j-ogm-quarkus It depends on the official Quarkiverse Neo4j extension. |
@michael-simons that's awesome! Are there any plans to migrate this work to the Quarkiverse Neo4j repository or under another Quarkiverse repository? PS: Moving to the Quarkiverse Neo4j repo makes more sense to me 😉 |
Thank you. We will push first a release out and check with a bunch of people if that’s enough for them to have a better experience. (If you have time, check out the project and I do see this project more in the Quarkiverse than in a Neo4j repo. However, I would like to keep it separate from the low level Neo4j client (or driver as we call it). There are a couple of interesting things in the project. Among them the integration test for the dev ui and the fact that one needs a native built item for generated resources. I was a bit surprised, thought that Quarkus would assume that. Anyway, stellar work on your side, found everything I needed in the Quarkus infrastructure. 👍 |
I've tried v1.0.0 today - works great! |
Closing as this is already done in https://github.com/michael-simons/neo4j-ogm-quarkus |
Description
The Neo4j Extension guide states that you need to use the Neo4j Cypher language to manipulate your Neo4j database. It would be nice if one could to simplify development with the Neo4j graph database and like JPA, using annotations on simple POJO domain objects.
That's the intention of the Neo4j-OGM project
Bonus points if a Panache extension is provided too.
Implementation ideas
Make the Neo4j extension depend on the neo4j-ogm libraries and allow injecting the corresponding SessionFactory/Session in CDI beans
The text was updated successfully, but these errors were encountered: