Skip to content

Conversation

@geoand
Copy link
Contributor

@geoand geoand commented Apr 23, 2020

Fixes: #8785

@geoand
Copy link
Contributor Author

geoand commented Apr 23, 2020

If you think I should add a new test containing these two extensions, I can obviously do that.

}

@TargetClass(com.sun.jna.Native.class)
final class JnaNativeSubstitutions {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this substitution targets a class which isn't MongoDB specific, does it belong here?

My concern is that if such subtitutions are kept within an extension, then they will eventually conflict with other extensions.

I guess it could be acceptable as a temporary solution, if there's an issue tracking a further improvement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the ideal situation would be to have a jna extension that does these substitutions just like we have with Netty.
That's probably a good thing to follow up with - an easy thing for someone to contribute as their first contribution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually put that ones in core considering they are targetting JDK classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a JDK class however. It's coming from this dependency:

<groupId>net.java.dev.jna</groupId>

public class SimpleSocketHandlerFunction implements SocketHandlerFunction {
@Override
public Socket apply(Options options, String host) throws IOException {
return Utils.standardSocket(options, host);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this perhaps log a warning or throw an exception if a MariaDB feature is being disabled?

We shouldn't silentily ignore configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea yeah! Throwing an exception I think it the proper way to go. WDYT?

Copy link
Contributor Author

@geoand geoand Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@geoand geoand requested a review from Sanne April 23, 2020 14:48
@geoand geoand marked this pull request as ready for review April 23, 2020 16:21
@gsmet gsmet merged commit c67568f into quarkusio:master Apr 23, 2020
@Sanne
Copy link
Member

Sanne commented Apr 23, 2020

funny, was checking the changes in the MariaDB driver and it seems this odd JNA comment in the MariaDB driver was actually introduced precisely to improve GraalVM AOT.. :)

Looks good!

@Sanne
Copy link
Member

Sanne commented Apr 23, 2020

ok well was going to merge but @gsmet preceded me. One really can't spend an extra minute checking details

@geoand
Copy link
Contributor Author

geoand commented Apr 23, 2020

Thanks folks

@gsmet gsmet added this to the 1.4.1.Final milestone Apr 23, 2020
@geoand geoand deleted the #8785 branch April 24, 2020 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quarkus-hibernate and quarkus-mongodb-client incompatibility

3 participants