Wicket 使用apache isis打开的sql连接未关闭
我使用ApacheISIS作为API,使用SQLServer作为数据库。我注意到数据库中执行查询的速度很慢。经过调查,我发现Apache ISIS打开的连接尚未关闭,处于休眠状态。这导致大量打开但处于休眠状态的连接,从而降低了性能。我阅读了apacheisis文档,发现连接池由apacheisis处理。是否需要添加一个属性,以便在会话关闭后关闭连接。我被困在这个问题上,任何帮助都将不胜感激。提前谢谢。干杯 编辑:Persistor_datanucleus.propertiesWicket 使用apache isis打开的sql连接未关闭,wicket,jdo,datanucleus,isis,Wicket,Jdo,Datanucleus,Isis,我使用ApacheISIS作为API,使用SQLServer作为数据库。我注意到数据库中执行查询的速度很慢。经过调查,我发现Apache ISIS打开的连接尚未关闭,处于休眠状态。这导致大量打开但处于休眠状态的连接,从而降低了性能。我阅读了apacheisis文档,发现连接池由apacheisis处理。是否需要添加一个属性,以便在会话关闭后关闭连接。我被困在这个问题上,任何帮助都将不胜感激。提前谢谢。干杯 编辑:Persistor_datanucleus.properties # Licens
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# configuration file for the JDO/DataNucleus objectstore
#
#
# hook to perform additional initialization when JDO class metadata is loaded
# default implementation will attempt to run 'create schema' for the specified schema.
#
# this implementation is installed by default:
#isis.persistor.datanucleus.classMetadataLoadedListener=org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata
# whether to persist the event data as a "clob" or as a "zipped" byte[]
# default is "zipped"
#isis.persistor.datanucleus.PublishingService.serializedForm=zipped
#####################################################################
#
# DataNucleus' configuration
#
# The 'isis.persistor.datanucleus.impl' prefix is stripped off,
# remainder is passed through to DataNucleus
#
#####################################################################
isis.persistor.datanucleus.impl.datanucleus.schema.autoCreateAll=true
isis.persistor.datanucleus.impl.datanucleus.schema.validateTables=true
isis.persistor.datanucleus.impl.datanucleus.schema.validateConstraints=true
#
# Require explicit persistence (since entities are Comparable and using ObjectContracts#compareTo).
# see http://www.datanucleus.org/products/accessplatform_3_0/jdo/transaction_types.html
#
isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit=false
#
# How column names are identified
# (http://www.datanucleus.org/products/datanucleus/jdo/orm/datastore_identifiers.html)
#
isis.persistor.datanucleus.impl.datanucleus.identifier.case=MixedCase
#
# L2 cache
# off except if explicitly marked as cacheable
# http://www.datanucleus.org/products/datanucleus/jdo/cache.html
#
isis.persistor.datanucleus.impl.datanucleus.cache.level2.type=none
isis.persistor.datanucleus.impl.datanucleus.cache.level2.mode=ENABLE_SELECTIVE
#
# uncomment to use JNDI rather than direct JDBC
#
#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactoryName=java:comp/env/jdbc/quickstart
#
# uncomment to use JTA resource
#
#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactory2Name=java:comp/env/jdbc/quickstart-nontx
#isis.persistor.datanucleus.impl.javax.jdo.option.TransactionType=JTA
#
#
# JDBC connection details
# ... are in persistor.properties
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#################################################################################
#
# Persistor
#
#################################################################################
# generally speaking this should not be enabled
isis.persistor.disableConcurrencyChecking=false
----Few lines that have been commented out----
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://localhost:1433;database=myDB
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=password
persistor.properties
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# configuration file for the JDO/DataNucleus objectstore
#
#
# hook to perform additional initialization when JDO class metadata is loaded
# default implementation will attempt to run 'create schema' for the specified schema.
#
# this implementation is installed by default:
#isis.persistor.datanucleus.classMetadataLoadedListener=org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata
# whether to persist the event data as a "clob" or as a "zipped" byte[]
# default is "zipped"
#isis.persistor.datanucleus.PublishingService.serializedForm=zipped
#####################################################################
#
# DataNucleus' configuration
#
# The 'isis.persistor.datanucleus.impl' prefix is stripped off,
# remainder is passed through to DataNucleus
#
#####################################################################
isis.persistor.datanucleus.impl.datanucleus.schema.autoCreateAll=true
isis.persistor.datanucleus.impl.datanucleus.schema.validateTables=true
isis.persistor.datanucleus.impl.datanucleus.schema.validateConstraints=true
#
# Require explicit persistence (since entities are Comparable and using ObjectContracts#compareTo).
# see http://www.datanucleus.org/products/accessplatform_3_0/jdo/transaction_types.html
#
isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit=false
#
# How column names are identified
# (http://www.datanucleus.org/products/datanucleus/jdo/orm/datastore_identifiers.html)
#
isis.persistor.datanucleus.impl.datanucleus.identifier.case=MixedCase
#
# L2 cache
# off except if explicitly marked as cacheable
# http://www.datanucleus.org/products/datanucleus/jdo/cache.html
#
isis.persistor.datanucleus.impl.datanucleus.cache.level2.type=none
isis.persistor.datanucleus.impl.datanucleus.cache.level2.mode=ENABLE_SELECTIVE
#
# uncomment to use JNDI rather than direct JDBC
#
#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactoryName=java:comp/env/jdbc/quickstart
#
# uncomment to use JTA resource
#
#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactory2Name=java:comp/env/jdbc/quickstart-nontx
#isis.persistor.datanucleus.impl.javax.jdo.option.TransactionType=JTA
#
#
# JDBC connection details
# ... are in persistor.properties
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#################################################################################
#
# Persistor
#
#################################################################################
# generally speaking this should not be enabled
isis.persistor.disableConcurrencyChecking=false
----Few lines that have been commented out----
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://localhost:1433;database=myDB
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=password
Apache Isis使用DataNucleus提供的连接池,可以通过设置DN配置属性来配置连接池,请参阅 要在persistor.properties中指定这些属性,请在它们前面加上“isis.persistor.datanucleus.impl”-直接传递这些属性 还可以配置ApacheISIS以使用JNDI提供的数据源,请参阅
你是说他们在连接池中?和定义您正在使用的连接池我不确定ISIS framework使用的是哪个连接池internally@BillyFrost您能告诉我您想查看哪个文件吗?因为我的数据库中有很多与isis相关的配置文件workspace@BillyFrost添加了似乎与DB配置相关的文件。因此它使用内部DataNucleus文档中的DBCP2连接池,如果关闭PM并关闭PMF,将释放连接