IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JDBC Java Discussion :

Crash de ma JVM


Sujet :

JDBC Java

  1. #1
    Futur Membre du Club
    Inscrit en
    Février 2007
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 16
    Points : 7
    Points
    7
    Par défaut Crash de ma JVM
    Bonjour à tous,
    Je suis actuellement en stage et je développe un questionnaire sous forme d'interface graphique.

    J'ai donc crée mes méthodes de lectures et d'écritures qui marchent après test.
    Mais quand je veux écrire dans ma base de donnée MS Access, via mon questionnaire la Virtual Machine plante.

    Pourtant cette même écriture avec les même paramètres en entrée fonctionne si on les rentres en dur dans une classe test :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    DbResponse.writeResponse(1, 9, 5, "ABC");
    Voici le rapport de log de la Virtual Machine :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    #
    # An unexpected error has been detected by Java Runtime Environment:
    #
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c901010, pid=3504, tid=1264
    #
    # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
    # Problematic frame:
    # C  [ntdll.dll+0x1010]
    #
    # An error report file with more information is saved as hs_err_pid3504.log
    #
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    #
    Le code a été testé sur deux machines différentes donc ça ne peut surement pas venir de la mémoire (qui a en plus été vérifiée) ni de ma Virtual Machine.

    Je suis à bout d'idée donc merci d'avance pour votre aide.

  2. #2
    Membre chevronné
    Avatar de CheryBen
    Inscrit en
    Mai 2005
    Messages
    1 599
    Détails du profil
    Informations personnelles :
    Âge : 42

    Informations forums :
    Inscription : Mai 2005
    Messages : 1 599
    Points : 2 197
    Points
    2 197
    Par défaut
    Bonjour, qu'y a-t-il dans hs_err_pid3504.log ?

  3. #3
    Futur Membre du Club
    Inscrit en
    Février 2007
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 16
    Points : 7
    Points
    7
    Par défaut
    Voici le log :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
     
    #
    # An unexpected error has been detected by Java Runtime Environment:
    #
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c901010, pid=3504, tid=1264
    #
    # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
    # Problematic frame:
    # C  [ntdll.dll+0x1010]
    #
    # If you would like to submit a bug report, please visit:
    #   <a href="http://java.sun.com/webapps/bugreport/crash.jsp" target="_blank">http://java.sun.com/webapps/bugreport/crash.jsp</a>
    #
     
    ---------------  T H R E A D  ---------------
     
    Current thread (0x02db5000):  JavaThread "AWT-EventQueue-0" [_thread_in_native, id=1264]
     
    siginfo: ExceptionCode=0xc0000005, reading address 0x00000018
     
    Registers:
    EAX=0x00000004, EBX=0x269da020, ECX=0x7ffa6000, EDX=0x00000004
    ESP=0x0931f2b8, EBP=0x0931f2d0, ESI=0x00000000, EDI=0x02ff1348
    EIP=0x7c901010, EFLAGS=0x00010246
     
    Top of Stack: (sp=0x0931f2b8)
    0x0931f2b8:   74355a16 00000004 02ff136c 7432139f
    0x0931f2c8:   02ff136c 02ff1348 0931f2e0 74322c5d
    0x0931f2d8:   02ff136c 02db50ec 0931f2f4 74325fa0
    0x0931f2e8:   02ff1348 74350000 00000001 0931f310
    0x0931f2f8:   7432740e 02ff1348 0931f330 00000003
    0x0931f308:   02a9bff8 02db50ec 0931f328 6d3f124e
    0x0931f318:   02ff1348 0931f330 02db5000 269da020
    0x0931f328:   0931f368 008ea430 00000000 0931f384 
     
    Instructions: (pc=0x7c901010)
    0x7c901000:   90 90 90 90 90 64 8b 0d 18 00 00 00 8b 54 24 04
    0x7c901010:   83 7a 14 00 75 4f f0 ff 42 04 75 19 8b 41 24 89 
     
     
    Stack: [0x092d0000,0x09320000),  sp=0x0931f2b8,  free space=316k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C  [ntdll.dll+0x1010]
    C  [ODBC32.dll+0x2c5d]
    C  [ODBC32.dll+0x5fa0]
    C  [ODBC32.dll+0x740e]
    C  [JdbcOdbc.dll+0x124e]
    j  sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
    j  sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
    j  sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(Ljava/lang/String;II)Ljava/sql/PreparedStatement;+55
    j  sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(Ljava/lang/String;)Ljava/sql/PreparedStatement;+8
    j  com.petris.matureField.database.DbResponse.writeResponse(IIILjava/lang/String;)V+18
    j  com.petris.matureField.ihm.frameQuestionnaire.FrameQuestionnaire$buttonsListener.actionPerformed(Ljava/awt/event/ActionEvent;)V+358
    j  javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+84
    j  javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V+5
    j  javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35
    j  javax.swing.DefaultButtonModel.setPressed(Z)V+117
    j  javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V+35
    j  java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+64
    j  javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
    j  java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
    j  java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
    j  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+562
    j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
    J  java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V
    j  java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+139
    j  java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
    j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
    j  java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19
    j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
    j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46
    J  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z
    j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
    j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
    j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
    j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
    j  java.awt.EventDispatchThread.run()V+9
    v  ~StubRoutines::call_stub
     
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j  sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
    j  sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
    j  sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(Ljava/lang/String;II)Ljava/sql/PreparedStatement;+55
    j  sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(Ljava/lang/String;)Ljava/sql/PreparedStatement;+8
    j  com.petris.matureField.database.DbResponse.writeResponse(IIILjava/lang/String;)V+18
    j  com.petris.matureField.ihm.frameQuestionnaire.FrameQuestionnaire$buttonsListener.actionPerformed(Ljava/awt/event/ActionEvent;)V+358
    j  javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+84
    j  javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V+5
    j  javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35
    j  javax.swing.DefaultButtonModel.setPressed(Z)V+117
    j  javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V+35
    j  java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+64
    j  javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
    j  java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
    j  java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
    j  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+562
    j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
    J  java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V
    j  java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+139
    j  java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
    j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
    j  java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19
    j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
    j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46
    J  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z
    j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
    j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
    j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
    j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
    j  java.awt.EventDispatchThread.run()V+9
    v  ~StubRoutines::call_stub
     
    ---------------  P R O C E S S  ---------------
     
    Java Threads: ( => current thread )
      0x00386400 JavaThread "DestroyJavaVM" [_thread_blocked, id=3488]
      0x02e60800 JavaThread "TimerQueue" daemon [_thread_blocked, id=3652]
    =>0x02db5000 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=1264]
      0x02b1d000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3588]
      0x02b1c000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3612]
      0x02b1b400 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3572]
      0x02a4d000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2736]
      0x02a48000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2620]
      0x02a47000 JavaThread "Attach Listener" daemon [_thread_blocked, id=2412]
      0x02a46000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1664]
      0x02a41400 JavaThread "Finalizer" daemon [_thread_blocked, id=3376]
      0x02a3d000 JavaThread "Reference Handler" daemon [_thread_blocked, id=3344]
     
    Other Threads:
      0x02a3bc00 VMThread [id=2768]
      0x02a4e400 WatcherThread [id=2572]
     
    VM state:not at safepoint (normal execution)
     
    VM Mutex/Monitor currently owned by a thread: None
     
    Heap
     def new generation   total 960K, used 533K [0x22960000, 0x22a60000, 0x22e40000)
      eden space 896K,  52% used [0x22960000, 0x229d5788, 0x22a40000)
      from space 64K, 100% used [0x22a40000, 0x22a50000, 0x22a50000)
      to   space 64K,   0% used [0x22a50000, 0x22a50000, 0x22a60000)
     tenured generation   total 4096K, used 2480K [0x22e40000, 0x23240000, 0x26960000)
       the space 4096K,  60% used [0x22e40000, 0x230ac168, 0x230ac200, 0x23240000)
     compacting perm gen  total 12288K, used 1658K [0x26960000, 0x27560000, 0x2a960000)
       the space 12288K,  13% used [0x26960000, 0x26afe8f8, 0x26afea00, 0x27560000)
        ro space 8192K,  62% used [0x2a960000, 0x2ae614a8, 0x2ae61600, 0x2b160000)
        rw space 12288K,  52% used [0x2b160000, 0x2b7a7278, 0x2b7a7400, 0x2bd60000)
     
    Dynamic libraries:
    0x00400000 - 0x00423000     C:\Program Files\Java\jre1.6.0_03\bin\javaw.exe
    0x7c900000 - 0x7c9b0000     C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f5000     C:\WINDOWS\system32\kernel32.dll
    0x77dd0000 - 0x77e6b000     C:\WINDOWS\system32\ADVAPI32.dll
    0x77e70000 - 0x77f01000     C:\WINDOWS\system32\RPCRT4.dll
    0x7e410000 - 0x7e4a0000     C:\WINDOWS\system32\USER32.dll
    0x77f10000 - 0x77f57000     C:\WINDOWS\system32\GDI32.dll
    0x76390000 - 0x763ad000     C:\WINDOWS\system32\IMM32.DLL
    0x7c340000 - 0x7c396000     C:\Program Files\Java\jre1.6.0_03\bin\msvcr71.dll
    0x6d7c0000 - 0x6da0a000     C:\Program Files\Java\jre1.6.0_03\bin\client\jvm.dll
    0x76b40000 - 0x76b6d000     C:\WINDOWS\system32\WINMM.dll
    0x6d310000 - 0x6d318000     C:\Program Files\Java\jre1.6.0_03\bin\hpi.dll
    0x76bf0000 - 0x76bfb000     C:\WINDOWS\system32\PSAPI.DLL
    0x6d770000 - 0x6d77c000     C:\Program Files\Java\jre1.6.0_03\bin\verify.dll
    0x6d3b0000 - 0x6d3cf000     C:\Program Files\Java\jre1.6.0_03\bin\java.dll
    0x6d7b0000 - 0x6d7bf000     C:\Program Files\Java\jre1.6.0_03\bin\zip.dll
    0x6d3f0000 - 0x6d3fd000     C:\Program Files\Java\jre1.6.0_03\bin\JdbcOdbc.dll
    0x74320000 - 0x7435d000     C:\WINDOWS\system32\ODBC32.dll
    0x77c10000 - 0x77c68000     C:\WINDOWS\system32\msvcrt.dll
    0x5d090000 - 0x5d12a000     C:\WINDOWS\system32\COMCTL32.dll
    0x7c9c0000 - 0x7d1d7000     C:\WINDOWS\system32\SHELL32.dll
    0x77f60000 - 0x77fd6000     C:\WINDOWS\system32\SHLWAPI.dll
    0x763b0000 - 0x763f9000     C:\WINDOWS\system32\comdlg32.dll
    0x773d0000 - 0x774d3000     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
    0x20000000 - 0x20017000     C:\WINDOWS\system32\odbcint.dll
    0x774e0000 - 0x7761d000     C:\WINDOWS\system32\ole32.dll
    0x77120000 - 0x771ab000     C:\WINDOWS\system32\OLEAUT32.dll
    0x5fe80000 - 0x5fe9b000     C:\WINDOWS\system32\odbccp32.dll
    0x77c00000 - 0x77c08000     C:\WINDOWS\system32\VERSION.dll
    0x77fe0000 - 0x77ff1000     C:\WINDOWS\system32\Secur32.dll
    0x76fd0000 - 0x7704f000     C:\WINDOWS\system32\CLBCATQ.DLL
    0x77050000 - 0x77115000     C:\WINDOWS\system32\COMRes.dll
    0x1b810000 - 0x1b84a000     C:\WINDOWS\system32\msjtes40.dll
    0x0f9a0000 - 0x0f9ab000     C:\WINDOWS\system32\VBAJET32.DLL
    0x0f9c0000 - 0x0fa22000     C:\WINDOWS\system32\expsrv.dll
    0x5ad70000 - 0x5ada8000     C:\WINDOWS\system32\uxtheme.dll
    0x6d000000 - 0x6d1c3000     C:\Program Files\Java\jre1.6.0_03\bin\awt.dll
    0x73000000 - 0x73026000     C:\WINDOWS\system32\WINSPOOL.DRV
    0x73760000 - 0x737a9000     C:\WINDOWS\system32\ddraw.dll
    0x73bc0000 - 0x73bc6000     C:\WINDOWS\system32\DCIMAN32.dll
    0x74720000 - 0x7476b000     C:\WINDOWS\system32\MSCTF.dll
    0x755c0000 - 0x755ee000     C:\WINDOWS\system32\msctfime.ime
    0x6d2b0000 - 0x6d303000     C:\Program Files\Java\jre1.6.0_03\bin\fontmanager.dll
    0x6d570000 - 0x6d583000     C:\Program Files\Java\jre1.6.0_03\bin\net.dll
    0x71ab0000 - 0x71ac7000     C:\WINDOWS\system32\WS2_32.dll
    0x71aa0000 - 0x71aa8000     C:\WINDOWS\system32\WS2HELP.dll
    0x6d590000 - 0x6d599000     C:\Program Files\Java\jre1.6.0_03\bin\nio.dll
    0x6d450000 - 0x6d474000     C:\Program Files\Java\jre1.6.0_03\bin\jpeg.dll
    0x6d1f0000 - 0x6d21f000     C:\Program Files\Java\jre1.6.0_03\bin\cmm.dll
    0x09700000 - 0x099c5000     C:\WINDOWS\system32\xpsp2res.dll
     
    VM Arguments:
    java_command: com.petris.matureField.MatureFields
    Launcher Type: SUN_STANDARD
     
    Environment Variables:
    PATH=C:\Program Files\Java\jre1.6.0_03\bin\client;C:\Program Files\Java\jre1.6.0_03\bin;C:\Program Files\Java\jre1.6.0_03\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program Files\ArcGIS\bin
    USERNAME=lasserre
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 9 Stepping 5, GenuineIntel
     
     
     
    ---------------  S Y S T E M  ---------------
     
    OS: Windows XP Build 2600 Service Pack 2
     
    CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 9 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2
     
    Memory: 4k page, physical 1046744k(315144k free), swap 2516264k(1953776k free)
     
    vm_info: Java HotSpot(TM) Client VM (1.6.0_03-b05) for windows-x86, built on Sep 24 2007 22:24:33 by "java_re" with unknown MS VC++:1310
    Vous voyez quelque chose ?

  4. #4
    Membre chevronné
    Avatar de CheryBen
    Inscrit en
    Mai 2005
    Messages
    1 599
    Détails du profil
    Informations personnelles :
    Âge : 42

    Informations forums :
    Inscription : Mai 2005
    Messages : 1 599
    Points : 2 197
    Points
    2 197
    Par défaut
    Malheureusement ça fait longtemps que j'ai utilisé JDBC, donc je ne vois pas grand chose mis à part une énorme consommation mémoire 1Go + 2.5Go de swap.

    L'erreur se situe ici :
    j sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
    j sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
    j sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(Ljava/lang/String;II)Ljava/sql/PreparedStatement;+55
    j sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(Ljava/lang/StringLjava/sql/PreparedStatement;+8
    j com.petris.matureField.database.DbResponse.writeResponse(IIILjava/lang/StringV+18
    Mais je ne peux pas dire pourquoi, le résultat de la requête est peut-être trop énorme? la base de données contient un grand nombre d'enregistrements? je ne suis pas sûr de pouvoir aider mais ça peut donner des indications à d'autres personnes.

  5. #5
    Futur Membre du Club
    Inscrit en
    Février 2007
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 16
    Points : 7
    Points
    7
    Par défaut
    Non ma base de donnée ne contient que très peu d'enregistrements.

    Voici le code de mon écriture en base de donnée.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    /**
             * Write the value and the comments on the Response table at the questionID
             * and systemID line
             * 
             * @param systemID :
             *           The system identifier we wanted to reach
             * @param questionID :
             *           The question identifier we wanted to reach
             * @param value :
             *           the value of the response we wanted to set
             * @param comment :
             *           the comment of the response we wanted to set
             */
    	public static void writeResponse(int systemID, int questionID, int value, String comment)
    	{
    		// Local variable use to create a PreparedStatement
    		PreparedStatement updateResponse = null;
     
    		try
    		{
    			// Creation of the PreparedStatement using the static Connection.
    			// updateResponse get the query.
    			// The ? in the query correspond to the parameter to give after
    			updateResponse = AccessDB.getConnection().prepareStatement(
    					"UPDATE Response SET responseValue = ?, comment = ?  WHERE systemID = ? AND questionID = ?");
    			logger.debug("The creation of the Response's prepareStatement is successfull");
     
    			// Initialization of the local variable cnt at 1
    			int cnt = 1;
     
    			// cnt = 1 and so, set the first parameter with value
    			updateResponse.setInt(cnt++, value);
     
    			// cnt = 2 and so, set the second parameter with comment
    			updateResponse.setString(cnt++, comment);
     
    			// cnt = 3 and so, set the third parameter with systemeID
    			updateResponse.setInt(cnt++, systemID);
     
    			// cnt = 4 and so, set the fourth parameter with questionID
    			updateResponse.setInt(cnt++, questionID);
     
    			// Execute the query with the parameter given before
    			updateResponse.executeUpdate();
    		}
    		catch (SQLException e)
    		{
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    			logger.info("The Response table access hasn't succeed");
    		}
    		finally
    		{
    			if (updateResponse != null)
    			{
    				try
    				{
    					updateResponse.close();
    				}
    				catch (SQLException e)
    				{
    					e.printStackTrace();
    				}
    			}
    		}
    	}
    De nouvelles idées ?

  6. #6
    Membre éprouvé Avatar de leminipouce
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Janvier 2004
    Messages
    754
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Agroalimentaire - Agriculture

    Informations forums :
    Inscription : Janvier 2004
    Messages : 754
    Points : 1 253
    Points
    1 253
    Par défaut
    Citation Envoyé par morph41 Voir le message
    Malheureusement ça fait longtemps que j'ai utilisé JDBC, donc je ne vois pas grand chose mis à part une énorme consommation mémoire 1Go + 2.5Go de swap.
    Salut,

    J'ai pas la réponse au problème, par contre la consommation mémoire est bien moindre :
    Citation Envoyé par system
    Memory: 4k page, physical 1046744k(315144k free), swap 2516264k(1953776k free)
    RAM: 1 046 - 315 = 730M utilisez sur l'ensemble du système. C'est vrai que ça fait beaucoup, mais avec quelques appli. qui tournent en arrière plan, c'est pas non plus si gros.
    Swap : 2 516 - 1 954 = 562M c'est pas la mort non plus vu que c'est au niveau système et non au niveau de la JVM.

  7. #7
    Futur Membre du Club
    Inscrit en
    Février 2007
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 16
    Points : 7
    Points
    7
    Par défaut
    Voila du nouveau !! :
    le crash de la jvm ne se fait que sur certains accès à ma base de donnée en gestion évènementielle alors que avec des paramètres rentré en séquentiel et en dur dans une classe de test ca marche.

    De plus je l'ai passé sur mon ordinateur perso avec Vista alors que l'autre est en XP, ma JVM ne crashe pas mais la console me retourne l'erreur suivante :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    java.sql.SQLException: General error
    	at sun.jdbc.odbc.JdbcOdbc.throwGenericSQLException(Unknown Source)
    	at sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(Unknown Source)
    	at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(Unknown Source)
    	at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(Unknown Source)
    	at com.petris.matureField.database.DbResponse.writeResponse(DbResponse.java:265)
    	at com.petris.matureField.ihm.frameQuestionnaire.FrameQuestionnaire$buttonsListener.actionPerformed(FrameQuestionnaire.java:1363)
    	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    	at java.awt.Component.processMouseEvent(Unknown Source)
    	at javax.swing.JComponent.processMouseEvent(Unknown Source)
    	at java.awt.Component.processEvent(Unknown Source)
    	at java.awt.Container.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Window.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Je suis toujours en panne d'inspiration merci d'avance pour ceux qui m'aident !!

  8. #8
    Futur Membre du Club
    Inscrit en
    Février 2007
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 16
    Points : 7
    Points
    7
    Par défaut
    Ouf j'ai réussi a contourner le problème.
    Alors a chaque fois que mes évènements "appuie sur un bouton" interviennent, j'ai ouvert une connexion crée mon statement et passé ma requête dans les listeners.
    Donc voila mon application marche, mes lecture et écriture dans la base de donnée fonctionnent donc si vous avez une solution pour nettoyer cette solution et faire que je ne sois pas obligé de creer une nouvelle connexion à chaque écoute du bouton.
    Merci d'avance.

  9. #9
    Membre expert

    Homme Profil pro
    Consultant informatique
    Inscrit en
    Janvier 2004
    Messages
    2 301
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2004
    Messages : 2 301
    Points : 3 675
    Points
    3 675
    Par défaut
    Citation Envoyé par key81190 Voir le message
    si vous avez une solution pour nettoyer cette solution et faire que je ne sois pas obligé de creer une nouvelle connexion à chaque écoute du bouton
    euh... pour moi c'est naturel, on ferme les connexions après utilisation...

  10. #10
    Membre averti
    Inscrit en
    Octobre 2007
    Messages
    311
    Détails du profil
    Informations forums :
    Inscription : Octobre 2007
    Messages : 311
    Points : 318
    Points
    318
    Par défaut
    Ou on utilise un pool de connexions qui économise les ouvertures / fermetures de connexion qui sont couteuses.

  11. #11
    Futur Membre du Club
    Inscrit en
    Février 2007
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 16
    Points : 7
    Points
    7
    Par défaut
    En fait à chaque fois que l'évènement pression d'un bouton arrive j'ai une requête normalement on ouvre la connexion en début d'application et on la ferme à la fin, la je suis obligé de l'ouvrir et de la fermer à chaque fois que j'envoie une requête à partir de l'évènement.
    Je rappelle que en dehors d'un évènement mes lectures et écritures fonctionnent très bien et je n'ai pas a ouvrir et fermer ma connexion à chaque fois que j'en fais une...
    Donc la ça marche mais bon si mon programme travaillait sur serveur ça deviendrait très long...
    Est ce que vous voyez d'où ça provient ?
    Puis faire un pool de connexions ok mais normalement avec une seule au démarrage de l application ça devrait marcher, non ?

  12. #12
    Membre averti
    Inscrit en
    Octobre 2007
    Messages
    311
    Détails du profil
    Informations forums :
    Inscription : Octobre 2007
    Messages : 311
    Points : 318
    Points
    318
    Par défaut
    Citation Envoyé par key81190 Voir le message
    Puis faire un pool de connexions ok mais normalement avec une seule au démarrage de l application ça devrait marcher, non ?
    Ouais, carrément... Tu fermes bien des resultsets, statements, ... ???

  13. #13
    Futur Membre du Club
    Inscrit en
    Février 2007
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 16
    Points : 7
    Points
    7
    Par défaut
    Oui on a vérifié, tous mes statements et preparedStatements sont ouverts lors des appels des methodes read ou write et fermés à la fin de mes méthodes.
    Donc c'est pour ça qu'on ne comprend pas.

  14. #14
    Membre averti
    Inscrit en
    Octobre 2007
    Messages
    311
    Détails du profil
    Informations forums :
    Inscription : Octobre 2007
    Messages : 311
    Points : 318
    Points
    318
    Par défaut
    http://saloon.javaranch.com/cgi-bin/...c&f=3&t=005471

    Le mec avait ce problème car la connexion était fermée entre temps... N'aurais-tu pas le même souci ? (time out, ... ?)

Discussions similaires

  1. Crash de la JVM avec insertRow
    Par croquette06 dans le forum JDBC
    Réponses: 4
    Dernier message: 07/01/2011, 09h55
  2. [BUG][JVM 6] crash du browser
    Par magnus2005 dans le forum Applets
    Réponses: 8
    Dernier message: 01/06/2007, 16h30
  3. [DEBUTANT] Crash JVM : Unexpected error
    Par foimpou dans le forum Langage
    Réponses: 5
    Dernier message: 03/04/2007, 11h40
  4. Toolkit.getDefaultToolkit() => crash JVM
    Par Tibo dans le forum Interfaces Graphiques en Java
    Réponses: 3
    Dernier message: 19/05/2006, 14h43
  5. [JVM] crash de la JVM
    Par xavdj dans le forum Général Java
    Réponses: 13
    Dernier message: 04/01/2006, 02h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo