Skip to content
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

[CBRD-25285] Add a new ClassLoader to avoid reloading classes that load JNI in a Java SP Server #5076

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

hgryoo
Copy link
Member

@hgryoo hgryoo commented Apr 2, 2024

http://jira.cubrid.org/browse/CBRD-25285

A new classloader (StoredProcedureStaticClassLoader) will be added to avoid reloading classes that load JNI. By loadjava's -j option, classes are copied to /java_static directory and the classloader will try to find classes in the path.
The classloader does not check whether any file is modified in the path, Also is not be re-initialized like StoredProcedureClassLoader. To update overwritten classes in /java_static, restarting Java SP server(cub_javasp) is required.

@hgryoo hgryoo self-assigned this Apr 2, 2024
@hgryoo hgryoo requested a review from beyondykk9 as a code owner April 2, 2024 06:19
@hgryoo hgryoo requested review from hyunikn and ctshim April 3, 2024 09:52
{0, 0, 0, 0}
};

while (1)
{
int option_index = 0;
int option_key = getopt_long (argc, argv, "yh", loadjava_option, &option_index);
int option_key = getopt_long (argc, argv, "y:jh", loadjava_option, &option_index);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add ':'?
Using ':' means there are arguments.
Does the '-y' option have additional arguments?

@@ -914,7 +914,8 @@ $set 34 MSGCAT_UTIL_SET_LOADJAVA
Usage: loadjava [OPTION] database-name java-class-file\n\
\n\
valid options:\n\
-y, --overwrite Klassendatei, wenn vorhanden, überschreiben, Standard nein\n
-y, --overwrite Klassendatei, wenn vorhanden, überschreiben, Standard nein\n\
-j, --jni add a Class or Jar to static loading for JNI\n
Copy link
Contributor

Choose a reason for hiding this comment

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

Class --> class

@hgryoo
Copy link
Member Author

hgryoo commented Apr 5, 2024

build-windows fails casued by compiling cubrid-jdbc with JDK 1.6 version.
The following error is shown.

EXEC : [javac] error : Source option 6 is no longer supported. Use 7 or later. [C:\Users\circleci\project\build\cubrid-jdbc\jdbc_build.vcxproj]
EXEC : [javac] error : Target option 6 is no longer supported. Use 7 or later. [C:\Users\circleci\project\build\cubrid-jdbc\jdbc_build.vcxproj]

It seems not related to this PR, I'm going to merge the PR.

@hgryoo hgryoo merged commit 5de0053 into CUBRID:develop Apr 5, 2024
9 of 10 checks passed
hgryoo added a commit to hgryoo/cubrid that referenced this pull request Apr 5, 2024
…ad JNI in a Java SP Server (CUBRID#5076)

http://jira.cubrid.org/browse/CBRD-25285

A new classloader (StoredProcedureStaticClassLoader) will be added to avoid reloading classes that load JNI. By loadjava's -j option, classes are copied to /java_static directory and the classloader will try to find classes in the path.
The classloader does not check whether any file is modified in the path, Also is not be re-initialized like StoredProcedureClassLoader. To update overwritten classes in /java_static, restarting Java SP server(cub_javasp) is required.
mhoh3963 pushed a commit that referenced this pull request Apr 5, 2024
…ad JNI in a Java SP Server (#5076) (#5090)

http://jira.cubrid.org/browse/CBRD-25285

A new classloader (StoredProcedureStaticClassLoader) will be added to avoid reloading classes that load JNI. By loadjava's -j option, classes are copied to /java_static directory and the classloader will try to find classes in the path.
The classloader does not check whether any file is modified in the path, Also is not be re-initialized like StoredProcedureClassLoader. To update overwritten classes in /java_static, restarting Java SP server(cub_javasp) is required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants