Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem when inserting data in JDataStore !

Status
Not open for further replies.

haux

Programmer
Apr 11, 2001
79
DZ
Hello ;)

I had created a table with JDataStore (JBuilder4 Pro),I can insert and read data using SQL query.
But i have trouble when inserting the same data many times, i have noted that inserting <20 times i have no trouble, but >20 my prog stop brutally!!! without intercepting my exception (in my exemple print in console &quot;Oups...&quot;)

I suppose i had omited something? !!!

thaks for all ;)

NB : i am using RedHat6.2+JBuilder4 pro
my test program :--------------------

import java.sql.*;
import java.math.*;

public class test {

public test() {

}
public static void main(String[] args) {
test test1 = new test();

String resultat=null;
Statement Requete = null;
ResultSet ResultatSet = null;
try{

Class.forName(&quot;com.borland.datastore.jdbc.DataStoreDriver&quot;);
Connection Contact = DriverManager.getConnection(&quot;jdbc:borland:dslocal:/root/essai/BD/projet/projet.jds&quot;,&quot;kerbachi&quot;,&quot;kerbachi&quot;);
System.out.println(&quot;Contact with JDataSore OK!&quot;);

Requete = Contact.createStatement();

}catch(SQLException e){
System.out.println(e.getMessage() );}
catch(ClassNotFoundException e){);}

try{
/*
HERE IS THE PROBLEM :(
*/
for (int c=0; c<27;c++){
String valeur = &quot;'AKB','002','012525','FF','DAAADEVE','013636','DDDDDDDD','COUCOU'&quot;;
Requete.executeUpdate(&quot;INSERT INTO \&quot;MESSAGES_RSFTA\&quot; values (&quot;+valeur+&quot;);&quot;);
System.out.println(&quot;INSERT INTO \&quot;MESSAGES_RSFTA\&quot; values (&quot;+valeur+&quot;);&quot;);

}
Requete.close();
}catch(SQLException e){
System.out.println(&quot;Oups...&quot;);}

System.exit(0);
}
}
 
Perhaps you would want to manually commit after each insertion of data. Something like:-

for (int c=0; c<27;c++){
String valeur = &quot;'AKB','002','012525','FF','DAAADEVE','013636','DDDDDDDD','COUCOU'&quot;;
Requete.executeUpdate(&quot;INSERT INTO \&quot;MESSAGES_RSFTA\&quot; values (&quot;+valeur+&quot;);&quot;);
System.out.println(&quot;INSERT INTO \&quot;MESSAGES_RSFTA\&quot; values (&quot;+valeur+&quot;);&quot;);
Contact.commit();
}

I am not sure if this would work. Btw, do this 'System.out.println(e)' instead of 'System.out.println(&quot;Oups...&quot;)' this will help to narrow down the possibility of what exception is caught.

If it doesn't work, please paste the exception caught onto the forum.

Hope this helps,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
Thanks LeonTang , i will give it a try, and iwill post ths result.
thanks for your reponse ;)
 
I have added Contact.commit() , but without success :(
I had also changed &quot;Oups&quot; by e.getMessage()
but my prog crach with this long incomprehensible message 8%o (i have RedHat 6.2 kernel 2.2.xx)

The message after craching is :-------------------------


SIGSEGV 11 (*) segmentation violation
stackpointer=0xbe1c1d08
SIGABRT 6 (*) abort process
stackpointer=0xbe1c17dc

Monitor pool info:
Initial monitor count: 32
Minimum number of free monitors before expansion: 5
Pool will next be expanded by: 36
Current total number of monitors: 72
Current number of free monitors: 31

Monitor Pool Dump (inflated object-monitors):
sys_mon_t:0x0804f730 infl_mon_t: 0x0804f308:
java.lang.ref.Reference$Lock@402F01C0/402F01C8: <unowned>
Waiting to be notified:
&quot;Reference Handler&quot; (0x80cf630)
sys_mon_t:0x0804f7b0 infl_mon_t: 0x0804f348:
java.lang.ref.ReferenceQueue$Lock@402EFE10/402EFE18: <unowned>
Waiting to be notified:
&quot;Finalizer&quot; (0x80d3290)
sys_mon_t:0x0804f830 infl_mon_t: 0x0804f388:
java.awt.EventQueue@403B0D88/403B0D90: <unowned>
Waiting to be notified:
&quot;AWT-EventQueue-0&quot; (0x84d58a8)
sys_mon_t:0x0804f870 infl_mon_t: 0x0804f3a8:
sun.awt.PostEventQueue@402E8548/402E8550: <unowned>
Waiting to be notified:
&quot;SunToolkit.PostEventQueue-0&quot; (0x84d2f08)
sys_mon_t:0x0804f9b0 infl_mon_t: 0x0804f448:
sun.awt.im.ExecutableInputMethodManager@403BCF80/403BCF88: <unowned>
Waiting to be notified:
&quot;AWT-InputMethodManager&quot; (0x855e708)
sys_mon_t:0x0804fb70 infl_mon_t: 0x0804f528:
javax.swing.TimerQueue@404B96A8/404B96B0: <unowned>
Waiting to be notified:
&quot;TimerQueue&quot; (0x86dbb58)
sys_mon_t:0x0804fbf0 infl_mon_t: 0x0804f568:
sun.awt.ScreenUpdater@402E7870/402E7878: <unowned>
Waiting to be notified:
&quot;Screen Updater&quot; (0x8724948)

JVM System Monitor Dump (registered monitors):
ACS Heap lock: <unowned>
System Heap lock: <unowned>
Sleep lock: <unowned>
Waiting to be notified:
&quot;Daemon&quot; (0x835cb48)
Method trace lock: <unowned>
UTF8 Cache lock: <unowned>
Heap lock: <unowned>
Rewrite Code lock: <unowned>
Monitor Cache lock: owner &quot;Thread-21&quot; (0x87c3ea0) 2 entries
JNI Pinning lock: <unowned>
JNI Global Reference lock: <unowned>
Classloader lock: <unowned>
Linking class lock: <unowned>
Binclass lock: <unowned>
Monitor Registry lock: owner &quot;Thread-21&quot; (0x87c3ea0) 2 entries
Thread queue lock: owner &quot;Thread-21&quot; (0x87c3ea0) 2 entries
Waiting to be notified:
&quot;Thread-0&quot; (0x80500c0)

Thread identifiers (as used in flat monitors):
ident e &quot;Thread-21&quot; (0x87c3ea0) ee 0x087c3cd4
ident d &quot;Thread-1&quot; (0x8795598) ee 0x087953cc
ident 2 &quot;Thread-0&quot; (0x80500c0) ee 0x0804fef4
ident a &quot;Screen Updater&quot; (0x8724948) ee 0x0872477c
ident c &quot;TimerQueue&quot; (0x86dbb58) ee 0x086db98c
ident b &quot;AWT-InputMethodManager&quot; (0x855e708) ee 0x0855e53c
ident 9 &quot;AWT-Motif&quot; (0x84ee0f0) ee 0x084edf24
ident 8 &quot;SunToolkit.PostEventQueue-0&quot; (0x84d2f08) ee 0x084d2d3c
ident 7 &quot;AWT-EventQueue-0&quot; (0x84d58a8) ee 0x084d56dc
ident 6 &quot;Daemon&quot; (0x835cb48) ee 0x0835c97c
ident 5 &quot;Finalizer&quot; (0x80d3290) ee 0x080d30c4
ident 4 &quot;Reference Handler&quot; (0x80cf630) ee 0x080cf464
ident 3 &quot;Signal dispatcher&quot; (0x80cad00) ee 0x080cab34

Java Object Monitor Dump (flat & inflated object-monitors):
sun.awt.ScreenUpdater@402E7870/402E7878
locknflags 80001500 Monitor inflated infl_mon 0x0804f568
sun.awt.PostEventQueue@402E8548/402E8550
locknflags 80000700 Monitor inflated infl_mon 0x0804f3a8
java.lang.ref.ReferenceQueue$Lock@402EFE10/402EFE18
locknflags 80000400 Monitor inflated infl_mon 0x0804f348
java.lang.ref.Reference$Lock@402F01C0/402F01C8
locknflags 80000200 Monitor inflated infl_mon 0x0804f308
gnu.io.RXTXPort@40323160/40323168
locknflags 000d0000 Flat locked by threadIdent d. Entrycount 1
project.projet@4035E4E8/4035E4F0
locknflags 000e0000 Flat locked by threadIdent e. Entrycount 1
project.DataBase@40390FC0/40390FC8
locknflags 000e0000 Flat locked by threadIdent e. Entrycount 1
java.awt.EventQueue@403B0D88/403B0D90
locknflags 80000600 Monitor inflated infl_mon 0x0804f388
sun.awt.im.ExecutableInputMethodManager@403BCF80/403BCF88
locknflags 80000c00 Monitor inflated infl_mon 0x0804f448
com.borland.datastore.jdbc.a@403D6A08/403D6A10
locknflags 000e0000 Flat locked by threadIdent e. Entrycount 1
javax.swing.TimerQueue@404B96A8/404B96B0
locknflags 80001300 Monitor inflated infl_mon 0x0804f528

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top