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

JDBC PreparedStatement for a table with 14 Foreign Keys crashing the Database #3763

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working Client interfaces major

Comments

@monetdb-team
Copy link

Date: 2015-07-10 09:47:50 +0200
From: Vijay Krishna <>
To: clients devs <>
Version: 11.19.15 (Oct2014-SP4)
CC: vijayakrishna55, @yzchang

Last updated: 2015-08-28 13:42:41 +0200

Comment 20989

Date: 2015-07-10 09:47:50 +0200
From: Vijay Krishna <>

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
Build Identifier:

While inserting a row into a table with (at least) 14 Foreign keys using JDBC Prepared Statement, the database is getting stopped.
Works fine for tables with less than 13 FKs..
The insert operation fails and the mserver has to be restarted to bring back the system to normalcy.
The same insert works fine for the table with 14 FKs when done through mclient manually.

Reproducible: Always

Steps to Reproduce:

1.Create a table that has 14 foreign keys.
2.Insert a row through JDBC Prepared Statement for this table.
3.While executing the line connection.prepareStatement(sqlString) the database crashes.

If you are using a Java IDE (like Eclipse), try testing this with a debugger at the mentioned line.
The debugger goes off for a long time.. It get returned directly to the exception catch block from this line..
The exception would be "java.sql.SQLException: Unable to connect (localhost:50000): Connection to server lost!"

This exception is thrown after the database has been killed.. There is no trace for why its being killed..

Comment 20990

Date: 2015-07-10 15:38:43 +0200
From: @yzchang

Hai Vijay,

Thanks for firing the bug report.

Can you please also provide us the schema and the java test program?

Also, can you please run the MonetDB server with GDB to catch where the server has crashed? You may need to recompile monetdb with the --enable-debug option.

Thanks!

Regards,

Jennie

Comment 20995

Date: 2015-07-14 06:20:56 +0200
From: Vijay Krishna <>

Created attachment 342
Sample java code

Attached file: testMonetFK.java (application/octet-stream, 1322 bytes)
Description: Sample java code

Comment 20996

Date: 2015-07-14 06:24:27 +0200
From: Vijay Krishna <>

The schema is simple and straight forward as follows.. Had 20 tables and a relationship table..

$ ./bin/mclient -d fkTestDB
Welcome to mclient, the MonetDB/SQL interactive terminal (Jan2014)
Database: MonetDB v11.17.9 (Jan2014), 'mapi:monetdb://vijay-1833:50000/fkTestDB'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>\d
TABLE sys.reltable
TABLE sys.table1
TABLE sys.table10
TABLE sys.table11
TABLE sys.table12
TABLE sys.table13
TABLE sys.table14
TABLE sys.table15
TABLE sys.table16
TABLE sys.table17
TABLE sys.table18
TABLE sys.table19
TABLE sys.table2
TABLE sys.table20
TABLE sys.table3
TABLE sys.table4
TABLE sys.table5
TABLE sys.table6
TABLE sys.table7
TABLE sys.table8
TABLE sys.table9

The 20 tables have same create table as follows...
sql>\d table1
CREATE TABLE "sys"."table1" (
"id1" BIGINT NOT NULL,
"name1" VARCHAR(50),
"createdtime" TIMESTAMP,
CONSTRAINT "table1_id1_pkey" PRIMARY KEY ("id1")
);
sql>\d table2
CREATE TABLE "sys"."table2" (
"id2" BIGINT NOT NULL,
"name2" VARCHAR(50),
"createdtime" TIMESTAMP,
CONSTRAINT "table2_id2_pkey" PRIMARY KEY ("id2")
);

The create table of reltable with only 14 foreign key relations is as follows...
sql>\d reltable
CREATE TABLE "sys"."reltable" (
"id0" BIGINT NOT NULL,
"id1" BIGINT,
"id2" BIGINT,
"id3" BIGINT,
"id4" BIGINT,
"id5" BIGINT,
"id6" BIGINT,
"id7" BIGINT,
"id8" BIGINT,
"id9" BIGINT,
"id10" BIGINT,
"id11" BIGINT,
"id12" BIGINT,
"id13" BIGINT,
"id14" BIGINT,
"id15" BIGINT,
"id16" BIGINT,
"id17" BIGINT,
"id18" BIGINT,
"id19" BIGINT,
"id20" BIGINT,
CONSTRAINT "reltable_id0_pkey" PRIMARY KEY ("id0"),
CONSTRAINT "reltable_id10_fkey" FOREIGN KEY ("id10") REFERENCES "sys"."table10" ("id10") ON DELETE SET NULL,
CONSTRAINT "reltable_id11_fkey" FOREIGN KEY ("id11") REFERENCES "sys"."table11" ("id11") ON DELETE SET NULL,
CONSTRAINT "reltable_id12_fkey" FOREIGN KEY ("id12") REFERENCES "sys"."table12" ("id12") ON DELETE SET NULL,
CONSTRAINT "reltable_id13_fkey" FOREIGN KEY ("id13") REFERENCES "sys"."table13" ("id13") ON DELETE SET NULL,
CONSTRAINT "reltable_id14_fkey" FOREIGN KEY ("id14") REFERENCES "sys"."table14" ("id14"),
CONSTRAINT "reltable_id1_fkey" FOREIGN KEY ("id1") REFERENCES "sys"."table1" ("id1") ON DELETE SET NULL,
CONSTRAINT "reltable_id2_fkey" FOREIGN KEY ("id2") REFERENCES "sys"."table2" ("id2") ON DELETE SET NULL,
CONSTRAINT "reltable_id3_fkey" FOREIGN KEY ("id3") REFERENCES "sys"."table3" ("id3") ON DELETE SET NULL,
CONSTRAINT "reltable_id4_fkey" FOREIGN KEY ("id4") REFERENCES "sys"."table4" ("id4") ON DELETE SET NULL,
CONSTRAINT "reltable_id5_fkey" FOREIGN KEY ("id5") REFERENCES "sys"."table5" ("id5") ON DELETE SET NULL,
CONSTRAINT "reltable_id6_fkey" FOREIGN KEY ("id6") REFERENCES "sys"."table6" ("id6") ON DELETE SET NULL,
CONSTRAINT "reltable_id7_fkey" FOREIGN KEY ("id7") REFERENCES "sys"."table7" ("id7") ON DELETE SET NULL,
CONSTRAINT "reltable_id8_fkey" FOREIGN KEY ("id8") REFERENCES "sys"."table8" ("id8") ON DELETE SET NULL,
CONSTRAINT "reltable_id9_fkey" FOREIGN KEY ("id9") REFERENCES "sys"."table9" ("id9") ON DELETE SET NULL
);

I am using MonetDB tar downloaded from Downloads... I am not compiling from source code.. Isn't this reproducible in the tar even...???

Comment 21133

Date: 2015-08-13 11:05:37 +0200
From: @sjoerdmullender

Fixed with changeset 08bc3bf282e3

Comment 21215

Date: 2015-08-28 13:42:41 +0200
From: @sjoerdmullender

Jul2015 has been released.

@monetdb-team monetdb-team added bug Something isn't working Client interfaces major labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Client interfaces major
Projects
None yet
Development

No branches or pull requests

2 participants