В проекте, в котором я работаю, у нас есть бэкэнд, разработанный в Scala, который использует play 2.6.0, scalike 2.5.2, mysql-connector-java 5.1.43.JVM является Oracle JDK 1,8_131.Я выполнил поиск, но не нашел ни одной темы, подходящей для моей проблемы.
Я получил еще один журнал с jdk 1.8_192: https://www.dropbox.com/s/ehngl0ek19zciq0/hs_err_pid1281.log?dl=0
Журнал:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f1c350d3cc0, pid=1194, tid=0x00007f1b9218b700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 26048 C2 com.mysql.jdbc.MysqlIO.checkErrorPacket(Lcom/mysql/jdbc/Buffer;)V (467 bytes) @ 0x00007f1c350d3cc0 [0x00007f1c350d3ca0+0x20]
--------------- T H R E A D ---------------
Current thread (0x00007f1bb0036000): JavaThread "application-custom-execution-contexts.database-2321" [_thread_in_Java, id=3976, stack(0x00007f1b9208b000,0x00007f1b9218c000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x00007f1c350d3cc0
Instructions: (pc=0x00007f1c350d3cc0)
0x00007f1c350d3ca0: 44 8b 56 08 49 c1 e2 03 49 3b c2 0f 85 6f 21 f7
0x00007f1c350d3cb0: fb 66 66 90 0f 1f 84 00 00 00 00 00 66 66 66 90
0x00007f1c350d3cc0: 89 84 24 00 c0 fe ff 55 48 83 ec 60 4c 8b d6 48
0x00007f1c350d3cd0: 89 54 24 08 44 8b 42 18 8b 6a 10 44 8b dd 41 ff
Register to memory mapping:
RAX=0x00000005ac5bfb78 is an oop
com.mysql.jdbc.Buffer
- klass: 'com/mysql/jdbc/Buffer'
RBX=0x0000000000000000 is an unknown value
RCX=0x0000000000000001 is an unknown value
RDX=0x00000005ac5bfb78 is an oop
com.mysql.jdbc.Buffer
- klass: 'com/mysql/jdbc/Buffer'
RSP=0x00007f1b9218a028 is pointing into the stack for thread: 0x00007f1bb0036000
RBP=0x00000005ac5bfb78 is an oop
com.mysql.jdbc.Buffer
- klass: 'com/mysql/jdbc/Buffer'
RSI=0x00000005a3d816d0 is an oop
com.mysql.jdbc.MysqlIO
- klass: 'com/mysql/jdbc/MysqlIO'
RDI=0x00000005a3d85e40 is pointing into object: 0x00000005a3d85e38
[B
- klass: {type array byte}
- length: 16384
R8 =0x00000005a3d816d0 is an oop
com.mysql.jdbc.MysqlIO
- klass: 'com/mysql/jdbc/MysqlIO'
R9 =0x00000000b58b7f73 is an unknown value
R10=0x00000005a3d7d088 is an oop
com.mysql.jdbc.JDBC4Connection
- klass: 'com/mysql/jdbc/JDBC4Connection'
R11=0x0000000000000001 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x0000000000000007 is an unknown value
R14=0x00000005a3d85e10 is an oop
com.mysql.jdbc.util.ReadAheadInputStream
- klass: 'com/mysql/jdbc/util/ReadAheadInputStream'
R15=0x00007f1bb0036000 is a thread
Stack: [0x00007f1b9208b000,0x00007f1b9218c000], sp=0x00007f1b9218a028, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 26048 C2 com.mysql.jdbc.MysqlIO.checkErrorPacket(Lcom/mysql/jdbc/Buffer;)V (467 bytes) @ 0x00007f1c350d3cc0 [0x00007f1c350d3ca0+0x20]
C 0x00000005bac1fd28
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00007f1c040f8800 JavaThread "application-custom-execution-contexts.database-2342" [_thread_blocked, id=3995, stack(0x00007f1b8f263000,0x00007f1b8f364000)]
0x00007f1c040ff000 JavaThread "application-custom-execution-contexts.database-2341" [_thread_blocked, id=3994, stack(0x00007f1b8f564000,0x00007f1b8f665000)]
0x00007f1c040f9800 JavaThread "application-custom-execution-contexts.database-2340" [_thread_blocked, id=3993, stack(0x00007f1b8f968000,0x00007f1b8fa69000)]
0x00007f1c040f5800 JavaThread "application-custom-execution-contexts.database-2338" [_thread_blocked, id=3992, stack(0x00007f1b8fa69000,0x00007f1b8fb6a000)]
0x00007f1c0016a800 JavaThread "application-custom-execution-contexts.database-2339" [_thread_blocked, id=3991, stack(0x00007f1b8fd6c000,0x00007f1b8fe6d000)]
0x00007f1c1425a000 JavaThread "application-custom-execution-contexts.database-2337" [_thread_blocked, id=3990, stack(0x00007f1b8ff6e000,0x00007f1b9006f000)]
0x00007f1c1416c800 JavaThread "application-custom-execution-
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap:
garbage-first heap total 524288K, used 247808K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 52 young (106496K), 9 survivors (18432K)
Metaspace used 132703K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
Heap Regions: (Y=young(eden), SU=young(survivor), HS=humongous(starts),
...
Card table byte_map: [0x00007f1bf0bff000,0x00007f1bf1cff000] byte_map_base: 0x00007f1bedeff000
Marking Bits (Prev, Next): (CMBitMap*) 0x00007f1c4005a4d0, (CMBitMap*) 0x00007f1c4005a478
Prev Bits: [0x00007f1bd3000000, 0x00007f1bdb800000)
Next Bits: [0x00007f1bdb800000, 0x00007f1be4000000)
Polling page: 0x00007f1c47c71000
CodeCache: size=245760Kb used=80836Kb max_used=81052Kb free=164923Kb
bounds [0x00007f1c31000000, 0x00007f1c35fc0000, 0x00007f1c40000000]
total_blobs=27146 nmethods=25929 adapters=1127
compilation: enabled
Compilation events (10 events):
Event: 5270.469 Thread 0x00007f1c402cc800 33431 3 play.core.routing.RouteParams$$Lambda$1757/2077515981::apply (12 bytes)
Event: 5270.470 Thread 0x00007f1c402cc800 nmethod 33431 0x00007f1c348cf150 code [0x00007f1c348cf400, 0x00007f1c348d0888]
Event: 5270.472 Thread 0x00007f1c402cc800 33432 3 play.core.routing.RouteParams::$anonfun$fromQuery$1 (22 bytes)
Event: 5270.472 Thread 0x00007f1c402cc800 nmethod 33432 0x00007f1c348cd010 code [0x00007f1c348cd2c0, 0x00007f1c348ce6a8]
Event: 5270.474 Thread 0x00007f1c402cc800 33435 3 scala.collection.immutable.VectorPointer::stabilize$ (6 bytes)
Event: 5270.474 Thread 0x00007f1c402cc800 nmethod 33435 0x00007f1c318e2b50 code [0x00007f1c318e2cc0, 0x00007f1c318e2e28]
Event: 5270.476 Thread 0x00007f1c402cc800 33433 3 play.core.routing.RouteParams$$Lambda$2505/822556919::get$Lambda (9 bytes)
Event: 5270.476 Thread 0x00007f1c402cc800 nmethod 33433 0x00007f1c319a5ed0 code [0x00007f1c319a6040, 0x00007f1c319a62f0]
Event: 5270.478 Thread 0x00007f1c402cc800 33434 3 play.core.routing.RouteParams$$Lambda$2505/822556919::<init> (10 bytes)
Event: 5270.478 Thread 0x00007f1c402cc800 nmethod 33434 0x00007f1c32089dd0 code [0x00007f1c32089f40, 0x00007f1c3208a150]
GC Heap History (10 events):
Event: 5163.800 GC heap before
{Heap before GC invocations=390 (full 0):
garbage-first heap total 524288K, used 457683K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 153 young (313344K), 4 survivors (8192K)
Metaspace used 132649K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
Event: 5163.820 GC heap after
Heap after GC invocations=391 (full 0):
garbage-first heap total 524288K, used 162183K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 9 young (18432K), 9 survivors (18432K)
Metaspace used 132649K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
}
Event: 5188.222 GC heap before
{Heap before GC invocations=391 (full 0):
garbage-first heap total 524288K, used 450951K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 150 young (307200K), 9 survivors (18432K)
Metaspace used 132650K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
Event: 5188.255 GC heap after
Heap after GC invocations=392 (full 0):
garbage-first heap total 524288K, used 159777K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 8 young (16384K), 8 survivors (16384K)
Metaspace used 132650K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
}
Event: 5209.076 GC heap before
{Heap before GC invocations=392 (full 0):
garbage-first heap total 524288K, used 452641K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 151 young (309248K), 8 survivors (16384K)
Metaspace used 132654K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
Event: 5209.090 GC heap after
Heap after GC invocations=393 (full 0):
garbage-first heap total 524288K, used 159744K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 8 young (16384K), 8 survivors (16384K)
Metaspace used 132654K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
}
Event: 5235.145 GC heap before
{Heap before GC invocations=393 (full 0):
garbage-first heap total 524288K, used 452608K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 151 young (309248K), 8 survivors (16384K)
Metaspace used 132656K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
Event: 5235.160 GC heap after
Heap after GC invocations=394 (full 0):
garbage-first heap total 524288K, used 161792K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 9 young (18432K), 9 survivors (18432K)
Metaspace used 132656K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
}
Event: 5265.832 GC heap before
{Heap before GC invocations=394 (full 0):
garbage-first heap total 524288K, used 450560K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 150 young (307200K), 9 survivors (18432K)
Metaspace used 132699K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
Event: 5265.850 GC heap after
Heap after GC invocations=395 (full 0):
garbage-first heap total 524288K, used 161792K [0x00000005a0000000, 0x00000005a0200800, 0x00000007c0000000)
region size 2048K, 9 young (18432K), 9 survivors (18432K)
Metaspace used 132699K, capacity 147524K, committed 147840K, reserved 1179648K
class space used 15698K, capacity 16649K, committed 16768K, reserved 1048576K
}
Deoptimization events (10 events):
Event: 5045.836 Thread 0x00007f1c20186800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007f1c35f4971c method=users.Routes$$anonfun$routes$1.applyOrElse(Lplay/api/mvc/RequestHeader;Lscala/Function1;)Ljava/lang/Object; @ 1383
Event: 5060.118 Thread 0x00007f1bfc117800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f1c356e5c4c method=java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(I)Z @ 130
Event: 5126.865 Thread 0x00007f1c425a1800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007f1c35dff214 method=polls.Routes$$anonfun$routes$1.applyOrElse(Lplay/api/mvc/RequestHeader;Lscala/Function1;)Ljava/lang/Object; @ 155
Event: 5126.867 Thread 0x00007f1c425a1800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007f1c353c5b9c method=router.Routes$$anonfun$routes$1.applyOrElse(Lplay/api/mvc/RequestHeader;Lscala/Function1;)Ljava/lang/Object; @ 1337
Event: 5126.881 Thread 0x00007f1c0411d000 Uncommon trap: reason=range_check action=make_not_entrant pc=0x00007f1c355da160 method=jdk.internal.org.objectweb.asm.Type.getType([CI)Ljdk/internal/org/objectweb/asm/Type; @ 2
Event: 5140.580 Thread 0x00007f1bfc10b800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007f1c35dff214 method=polls.Routes$$anonfun$routes$1.applyOrElse(Lplay/api/mvc/RequestHeader;Lscala/Function1;)Ljava/lang/Object; @ 155
Event: 5140.580 Thread 0x00007f1bfc10b800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007f1c353c5b9c method=router.Routes$$anonfun$routes$1.applyOrElse(Lplay/api/mvc/RequestHeader;Lscala/Function1;)Ljava/lang/Object; @ 1337
Event: 5208.353 Thread 0x00007f1c20186800 Uncommon trap: reason=speculate_class_check action=maybe_recompile pc=0x00007f1c3517666c method=scala.Option.getOrElse(Lscala/Function0;)Ljava/lang/Object; @ 1
Event: 5219.043 Thread 0x00007f1c425a1800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007f1c34adfec4 method=services.internal.CommentInternalServiceImpl$$Lambda$2930/225655434.apply(Ljava/lang/Object;)Ljava/lang/Object; @ 21
Event: 5219.043 Thread 0x00007f1c425a1800 Uncommon trap: reason=speculate_class_check action=maybe_recompile pc=0x00007f1c34a6f868 method=scala.Option.exists(Lscala/Function1;)Z @ 1
Internal exceptions (10 events):
Event: 5249.703 Thread 0x00007f1c410a7800 Exception <a 'java/io/FileNotFoundException'> (0x00000005b8c8f5b0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 5249.703 Thread 0x00007f1c410a7800 Exception <a 'java/security/PrivilegedActionException'> (0x00000005b8c97220) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 5249.703 Thread 0x00007f1c410a7800 Exception <a 'java/security/PrivilegedActionException'> (0x00000005b8c97618) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 5249.704 Thread 0x00007f1c410a7800 Exception <a 'java/security/PrivilegedActionException'> (0x00000005b8ca4e40) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 5249.704 Thread 0x00007f1c410a7800 Exception <a 'java/security/PrivilegedActionException'> (0x00000005b8ca5238) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 5249.704 Thread 0x00007f1c410a7800 Exception <a 'java/security/PrivilegedActionException'> (0x00000005b8cc8720) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 5249.704 Thread 0x00007f1c410a7800 Exception <a 'java/security/PrivilegedActionException'> (0x00000005b8cc8b18) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 5249.704 Thread 0x00007f1c410a7800 Exception <a 'java/security/PrivilegedActionException'> (0x00000005b8cd6a40) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 5249.704 Thread 0x00007f1c410a7800 Exception <a 'java/security/PrivilegedActionException'> (0x00000005b8cd6e38) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 5249.704 Thread 0x00007f1c410a7800 Exception <a 'java/io/FileNotFoundException'> (0x00000005b8cdd858) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/prims/jni.cpp, line 709]
VM Arguments:
jvm_args: -Duser.dir=/opt/project-core-rest/core -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -XX:ConcGCThreads=4 -XX:ParallelGCThreads=8 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/var/log/project-core-rest/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=100 -XX:GCLogFileSize=49M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=16000 -Dcom.sun.management.jmxremote.rmi.port=16000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dconfig.file=/opt/project-core-rest/config/project-core-rest.conf -Dlogger.resource=logback-pro.xml -Djava.net.preferIPv4Stack=true -Dpidfile.path=/var/run/project.com/project-core-rest.pid -Duser.timezone=GMT -XX:ErrorFile=/usr/share/NAS/errors/hs_err_pid%p.log -Xms512M -Xmx8704M
java_command: play.core.server.ProdServerStart
java_class_path (initial): /opt/project-core-rest/core/lib/../conf/:/opt/project-core-rest/core/lib/com.project.project-1.2.18-sans-externalized.jar:/opt/project-core-rest/core/lib/scala-faker_2.12-0.4-SNAPSHOT.jar:/opt/project-core-rest/core/lib/org.scala-lang.scala-library-2.12.3.jar:/opt/project-core-rest/core/lib/com.sksamuel.scapegoat.scalac-scapegoat-plugin_2.12-1.3.1.jar:/opt/project-core-rest/core/lib/org.scala-lang.scala-reflect-2.12.3.jar:/opt/project-core-rest/core/lib/org.scala-lang.modules.scala-xml_2.12-1.0.6.jar:/opt/project-core-rest/core/lib/com.typesafe.play.twirl-api_2.12-1.3.3.jar:/opt/project-core-rest/core/lib/com.typesafe.play.play-server_2.12-2.6.2.jar:/opt/project-core-rest/core/lib/com.typesafe.play.play_2.12-2.6.2.jar:/opt/project-core-rest/core/lib/com.typesafe.play.build-link-2.6.2.jar:/opt/project-core-rest/core/lib/com.typesafe.play.play-exceptions-2.6.2.jar:/opt/project-core-rest/core/lib/com.typesafe.play.play-netty-utils-2.6.2.jar:/opt/project-core-rest/core/lib/org.slf4j.slf4j-api-1.7.25.jar:/opt/project-core-rest/core/lib/org.slf4j.jul-to-slf4j-1.7.25.jar:/opt/project-core-rest/core/lib/org.slf4j.jcl-over-slf4j-1.7.25.jar:/opt/project-core-rest/core/lib/com.typesafe.play.play-streams_2.12-2.6.2.jar:/opt/project-core-rest/core/lib/org.reactivestreams.reactive-streams-1.0.0.jar:/opt/project-core-rest/core/lib/com.typesafe.akka.akka-stream_2.12-2.5.3.jar:/opt/project-core-rest/core/lib/com.typesafe.akka.akka-actor_2.12-2.5.3.jar:/opt/project-core-rest/core/lib/com.typesafe.config-1.3.1.jar:/opt/project-core-rest/core/lib/org.scala-lang.modules.scala-java8-compat_2.12-0.8.0.jar:/opt/project-core-rest/core/lib/org.scala-lang.modules.scala-parser-combinators_2.12-1.0.6.jar:/opt/project-core-rest/core/lib/com.typesafe.akka.akka-slf4j_2.12-2.5.3.jar:/opt/project-core-rest/core/lib/com.fasterxml.jackson.core.jackson-core-2.8.9.jar:/opt/project-core-rest/core/lib/com.fasterxml.jackson.core.jackson-annotations-2.8.9.jar:/opt/project-core-r
Launcher Type: SUN_STANDARD
--------------- S Y S T E M ---------------
OS:PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
uname:Linux 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64
libc:glibc 2.19 NPTL 2.19
rlimit: STACK 8192k, CORE infinity, NPROC 62408, NOFILE 65536, AS infinity
load average:0.09 0.15 0.16
/proc/meminfo:
MemTotal: 15994192 kB
MemFree: 11119944 kB
MemAvailable: 14589100 kB
Buffers: 20696 kB
Cached: 3591220 kB
SwapCached: 0 kB
Active: 1227552 kB
Inactive: 3491436 kB
Active(anon): 1107188 kB
Inactive(anon): 8304 kB
Active(file): 120364 kB
Inactive(file): 3483132 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 268 kB
Writeback: 0 kB
AnonPages: 1107096 kB
Mapped: 49360 kB
Shmem: 8416 kB
Slab: 81720 kB
SReclaimable: 69188 kB
SUnreclaim: 12532 kB
KernelStack: 4080 kB
PageTables: 4376 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 7997096 kB
Committed_AS: 1197444 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 29936 kB
VmallocChunk: 34359707655 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 51176 kB
DirectMap2M: 2613248 kB
DirectMap1G: 13631488 kB
Memory: 4k page, physical 15994192k(11119944k free), swap 0k(0k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.131-b11) for linux-amd64 JRE (1.8.0_131-b11), built on Mar 15 2017 01:23:40 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
time: Mon Dec 3 16:54:03 2018
elapsed time: 5272 seconds (0d 1h 27m 52s)
Я удалил часть журнала, если вам нужно что-то конкретное, я пишу это.Заранее благодарим за помощь.
Пример кода, взаимодействующего с BBDD, остальные доступы к таблицам аналогичны.
package models.generated
import models.generated.TableQuizQuestion.cqq
import scalikejdbc._
case class TableQuiz(
TableId: Long,
TableQuizCategoryId: Option[Long] = None,
randomizeQuestions: Boolean,
timeSecondsLimit: Option[Int] = None,
totalAnswerLimit: Option[Int] = None,
questionsDisposition: String
) {
def save()(implicit session: DBSession): TableQuiz = TableQuiz.save(this)(session)
def destroy(): Int = TableQuiz.destroy(this)
}
object TableQuiz extends SQLSyntaxSupport[TableQuiz] {
override val tableName = "Table_QUIZ"
override val columns = Seq("Table_id", "Table_quiz_category_id", "randomize_questions", "time_seconds_limit", "total_answer_limit", "questions_disposition")
def apply(cq: SyntaxProvider[TableQuiz])(rs: WrappedResultSet): TableQuiz = apply(cq.resultName)(rs)
def apply(cq: ResultName[TableQuiz])(rs: WrappedResultSet): TableQuiz = new TableQuiz(
TableId = rs.get(cq.TableId),
TableQuizCategoryId = rs.get(cq.TableQuizCategoryId),
randomizeQuestions = rs.get(cq.randomizeQuestions),
timeSecondsLimit = rs.get(cq.timeSecondsLimit),
totalAnswerLimit = rs.get(cq.totalAnswerLimit),
questionsDisposition = rs.get(cq.questionsDisposition)
)
val cq = TableQuiz.syntax("cq")
override val autoSession = AutoSession
def find(TableId: Long)(implicit session: DBSession): Option[TableQuiz] = {
withSQL {
select.from(TableQuiz as cq).where.eq(cq.TableId, TableId)
}.map(TableQuiz(cq.resultName)).single.apply()
}
def findAll()(implicit session: DBSession): List[TableQuiz] = {
withSQL(select.from(TableQuiz as cq)).map(TableQuiz(cq.resultName)).list.apply()
}
def countAll()(implicit session: DBSession): Long = {
withSQL(select(sqls.count).from(TableQuiz as cq)).map(rs => rs.long(1)).single.apply().get
}
def findBy(where: SQLSyntax)(implicit session: DBSession): Option[TableQuiz] = {
withSQL {
select.from(TableQuiz as cq).where.append(where)
}.map(TableQuiz(cq.resultName)).single.apply()
}
def findAllBy(where: SQLSyntax)(implicit session: DBSession): List[TableQuiz] = {
withSQL {
select.from(TableQuiz as cq).where.append(where)
}.map(TableQuiz(cq.resultName)).list.apply()
}
def countBy(where: SQLSyntax)(implicit session: DBSession): Long = {
withSQL {
select(sqls.count).from(TableQuiz as cq).where.append(where)
}.map(_.long(1)).single.apply().get
}
def create(
TableId: Long,
TableQuizCategoryId: Option[Long] = None,
randomizeQuestions: Boolean,
timeSecondsLimit: Option[Int] = None,
totalAnswerLimit: Option[Int] = None,
questionsDisposition: String
)(implicit session: DBSession): TableQuiz = {
withSQL {
insert.into(TableQuiz).namedValues(
column.TableId -> TableId,
column.TableQuizCategoryId -> TableQuizCategoryId,
column.randomizeQuestions -> randomizeQuestions,
column.timeSecondsLimit -> timeSecondsLimit,
column.totalAnswerLimit -> totalAnswerLimit,
column.questionsDisposition -> questionsDisposition
)
}.update.apply()
TableQuiz(
TableId = TableId,
TableQuizCategoryId = TableQuizCategoryId,
randomizeQuestions = randomizeQuestions,
timeSecondsLimit = timeSecondsLimit,
totalAnswerLimit = totalAnswerLimit,
questionsDisposition = questionsDisposition
)
}
def batchInsert(entities: Seq[TableQuiz])(implicit session: DBSession): List[Int] = {
val params: Seq[Seq[(Symbol, Any)]] = entities.map(entity =>
Seq(
'TableId -> entity.TableId,
'TableQuizCategoryId -> entity.TableQuizCategoryId,
'randomizeQuestions -> entity.randomizeQuestions,
'timeSecondsLimit -> entity.timeSecondsLimit,
'totalAnswerLimit -> entity.totalAnswerLimit,
'questionsDisposition -> entity.questionsDisposition
))
SQL("""insert into Table_QUIZ(
Table_id,
Table_quiz_category_id,
randomize_questions,
time_seconds_limit,
total_answer_limit,
questions_disposition
) values (
{TableId},
{TableQuizCategoryId},
{randomizeQuestions},
{timeSecondsLimit},
{totalAnswerLimit},
{questionsDisposition}
)""").batchByName(params: _*).apply[List]()
}
def save(entity: TableQuiz)(implicit session: DBSession): TableQuiz = {
withSQL {
update(TableQuiz).set(
column.TableId -> entity.TableId,
column.TableQuizCategoryId -> entity.TableQuizCategoryId,
column.randomizeQuestions -> entity.randomizeQuestions,
column.timeSecondsLimit -> entity.timeSecondsLimit,
column.totalAnswerLimit -> entity.totalAnswerLimit,
column.questionsDisposition -> entity.questionsDisposition
).where.eq(column.TableId, entity.TableId)
}.update.apply()
entity
}
def destroy(entity: TableQuiz): Int = {
DB localTx { implicit session =>
withSQL {
delete.from(TableQuiz).where.eq(column.TableId, entity.TableId)
}.update.apply()
}
}
/*
delete cq from Table_QUIZ cq
join Table c on c.id = cq.Table_id
and c.owner_id = @my_user_id;
*/
def findByUserId(userId: Long): List[TableQuiz] = {
DB localTx { implicit session =>
withSQL {
select
.from(TableQuiz as TableQuiz.cq)
.join(Table as Table.c)
.on(TableQuiz.cq.column("Table_id"), Table.c.column("id"))
.where.append(sqls.eq(Table.c.ownerId, userId))
}.map(TableQuiz(cq.resultName)).list().apply()
}
}
def deleteByUserId(userId: Long)(implicit session: DBSession): Int = {
//disableSafeMode()
val subQuery: SQLSyntax =
select(Table.c.column("id"))
.from(Table as Table.c)
.where.append(sqls.eq(Table.c.ownerId, userId)).toSQLSyntax
val where = sqls.in(TableQuiz.column.TableId, subQuery)
withSQL { delete.from(TableQuiz).where(where)}.update.apply()
}
}