在我的应用程序中,我使用20个线程来完成工作.每个线程调用远程Web服务并更新Oracle DB.Jboss重启后,作业无法更新数据库,但我在日志中找到的例外情况如下:
2017-11-08 23:36:20,706 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 21) javax.resource.ResourceException: IJ000460: Error checking for a transaction
2017-11-08 23:36:20,706 ERROR [org.jboss.as.ejb3] (EJB default - 16) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Could not open connection
2017-11-08 23:36:20,707 ERROR [org.jboss.as.ejb3] (EJB default - 20) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Could not open connection
2017-11-08 23:36:20,707 ERROR [org.jboss.as.ejb3] (EJB default - 19) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Could not open connection
2017-11-08 23:36:20,710 ERROR [org.jboss.as.ejb3] (EJB default - 21) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Could not open connection
2017-11-08 23:36:20,711 ERROR [org.jboss.as.ejb3.invocation] (EJB default - …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将 60 mb 的 CSV 文件上传到我的应用程序。但是当我将文件保存到服务器时,它只包含原始记录的部分(25 mb)。此问题仅随机发生。
@fileupload.route('/loadfile',methods = ['POST'])
def store_to_db():
for _file in request.files.getlist('filelist'):
name, ext = FileUtil.get_filename_without_ext(_file.filename)#fetching file name and extension
fd, path = tempfile.mkstemp(suffix=ext, prefix=name)#saving file as temp
os.write(fd, _file.read())
try:
file_upload_service.savefiletodb(path)
except Exception as e:
logger.info(str(e))
os.close(fd)
Run Code Online (Sandbox Code Playgroud)
上传端代码:
data= {}
url_path = 'localhost:5000/loadfile'
data['filelist']=open('employe.txt', 'rb')
resp = requests.post(url=url_path, files=data)
Run Code Online (Sandbox Code Playgroud)
知道为什么它的行为是这样吗?
笔记:
当我通过邮递员上传时,我没有遇到任何问题。
如果我通过代码上传,有时我会得到部分文件。
日志中的文件对象,当通过邮递员上传时
'employee.TXT' ('text/plain')>
日志中的文件对象,当通过代码上传时
'employee.TXT'('无')>
我正在尝试使用 angular-notifier(version : 4.1.1) 在单击按钮后显示通知。
即使在按钮单击后,通知也没有显示。
你能帮帮我吗?
以下是我使用的文件:
在app.module.ts 中:
const customNotifierOptions: NotifierOptions = {
position: {
horizontal: {
position: 'left',
distance: 12
},
vertical: {
position: 'bottom',
distance: 12,
gap: 10
}
},
theme: 'material',
behaviour: {
autoHide: 5000,
onClick: false,
onMouseover: 'pauseAutoHide',
showDismissButton: true,
stacking: 4
},
animations: {
enabled: true,
show: {
preset: 'slide',
speed: 300,
easing: 'ease'
},
hide: {
preset: 'fade',
speed: 300,
easing: 'ease',
offset: 50
},
shift: …
Run Code Online (Sandbox Code Playgroud)