ajax+mysql并发问题,求大神指点!

项目环境是LNMP
项目的前后端交互是使用ajax
出现问题的情景:
网站用户一次性提交一组数据,需要ajax分为3000条批量提交到后台,该后台接口的主要功能是数据库写入操作,但是在ajax批量发出3000个请求的时候,这一堆请求里面会有1至5个不等,的请求状态直接是failed,也就是直接请求失败了,请问这是什么原因造成的?我该怎么解决。在线请大神来支招!感谢!

3个回答

不是什么大神,请求失败的相关截图贴一下看看,大家才能帮您看看。

hu_belif
hu_beliefs 回复yu19861128: 楼下正解,需要加一个Redis或消息队列来减低失败几率,减轻ajax与数据库的负载。
11 个月之前 回复
yu19861128
yu19861128 就是批量ajax请求后端的时候,会出现一些请求失败的情况
11 个月之前 回复
yu19861128
yu19861128 图片在下面,您可以看下是什么情况
11 个月之前 回复

图片说明
就是这种情况,批量提交ajax请求,这个是一次性ajax想后台提交了3000条数据,其中会有一些请求出现一些404,502,failed的错误,请问这是什么原因造成的呢?该如何解决这个问题?

不要直接往数据库里面写,在数据库的前面,架一个缓存或者消息队列,比如redis和rabbitmq,放到缓存或者消息队列之后,在定时把数据从缓存或者消息队列写入数据库,这样可以减少数据库的压力,也可以减少ajax失败的几率.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
mysql 存储过程 求大神指点
在SqlServer中编写的 这个语句 rnDECLARE @t TABLE(id INT ,class VARCHAR(100) ,pid INT)rnINSERT INTO trn executern ( 'SELECT ' + idName + ' AS id,' + classNamern + ' AS class,' + pidName + ' AS pid FROM ' + tableNamern + ''rn )rnrn如何转换成可以在 mysql中也能执行,现在转换成下面格式,但execute处出错,要怎么修改才能执行呢??rnCREATE TEMPORARY TABLE t (id INT ,class VARCHAR(100) ,pid INT);rnINSERT INTO trn executern ( 'SELECT ' + idName + ' AS id,' + classNamern + ' AS class,' + pidName + ' AS pid FROM ' + tableNamern + ''rn )rnrn
求大神指点 求大神指点
a表按照b表的规则转换到c表上去rnrnrna表按照b表的规则转换到c表上去rnrnrnrnUSE [erp_zfym]rnGOrn/****** 对象: Table [dbo].[TB_DataPlat] 脚本日期: 08/26/2013 11:23:26 ******/rnSET ANSI_NULLS ONrnGOrnSET QUOTED_IDENTIFIER ONrnGOrnSET ANSI_PADDING ONrnGOrnCREATE TABLE [dbo].[TB_DataPlat](rn [DataID] [int] NOT NULL,rn [PFKID] [int] NULL,rn [UseType] [int] NULL,rn [DataSign] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,rn [Data] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data1] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data2] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data3] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data4] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data5] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data6] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data7] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data8] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data9] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data10] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data11] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data12] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data13] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data14] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data15] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data16] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data17] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data18] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data19] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data20] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data21] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data22] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data23] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data24] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data25] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data26] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data27] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data28] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data29] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data30] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data31] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data32] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data33] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data34] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data35] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data36] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data37] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data38] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data39] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data40] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data41] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data42] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data43] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data44] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data45] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data46] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data47] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data48] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data49] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data50] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data51] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data52] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data53] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data54] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data55] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data56] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data57] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data58] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data59] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data60] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data61] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data62] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data63] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data64] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data65] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data66] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data67] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data68] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data69] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data70] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data71] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data72] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data73] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data74] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data75] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data76] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data77] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data78] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data79] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data80] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data81] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data82] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data83] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data84] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data85] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data86] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data87] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data88] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data89] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data90] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data91] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data92] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data93] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data94] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data95] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data96] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data97] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data98] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data99] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn [Data100] [varchar](max) COLLATE Chinese_PRC_CI_AS NULL,rn CONSTRAINT [PK_TB_DataPlat] PRIMARY KEY CLUSTERED rn(rn [DataID] ASCrn)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]rn) ON [PRIMARY]rnrnGOrnSET ANSI_PADDING OFFrnrnrnrnUSE [erp_zfym]rnGOrn/****** 对象: Table [dbo].[PP_CraftData] 脚本日期: 08/26/2013 11:24:04 ******/rnSET ANSI_NULLS ONrnGOrnSET QUOTED_IDENTIFIER ONrnGOrnSET ANSI_PADDING ONrnGOrnCREATE TABLE [dbo].[PP_CraftData](rn [CraftDataID] [int] IDENTITY(1,1) NOT NULL,rn [DataPlatID] [int] NULL,rn [CraftID] [int] NULL,rn [ProcessID] [int] NULL,rn [GoodsID] [int] NULL,rn [ProductID] [int] NULL,rn [ProductCode] [varchar](60) COLLATE Chinese_PRC_CI_AS NULL,rn [Machine] [int] NULL,rn [StandardValue] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,rn [Remark] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,rn [OrderNO] [int] NULL,rn [Flag] [char](1) COLLATE Chinese_PRC_CI_AS NULL,rn [RelateID] [int] NULL,rn [ParentID] [int] NULL,rn [OpID] [int] NULL,rn [OpDate] [datetime] NULL,rn [CraftType] [int] NULL,rn CONSTRAINT [PK_PP_CraftData] PRIMARY KEY CLUSTERED rn(rn [CraftDataID] ASCrn)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]rn) ON [PRIMARY]rnrnGOrnSET ANSI_PADDING OFFrnrnUSE [erp_zfym]rnGOrn/****** 对象: Table [dbo].[PP_CraftDataProperty] 脚本日期: 08/28/2013 09:49:06 ******/rnSET ANSI_NULLS ONrnGOrnSET QUOTED_IDENTIFIER ONrnGOrnSET ANSI_PADDING ONrnGOrnCREATE TABLE [dbo].[PP_CraftDataProperty](rn [CraftDataProID] [char](10) COLLATE Chinese_PRC_CI_AS NULL,rn [CraftDataID] [int] NULL,rn [DataPlatID] [int] NULL,rn [DataPFKID] [int] NULL,rn [CraftID] [int] NULL,rn [RowSign] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,rn [ProID] [int] NULL,rn [Data] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,rn [Type] [int] NULL,rn [UseType] [int] NULL,rn [ProType] [int] NULL,rn [RateType] [int] NULL,rn [Rate] [decimal](10, 4) NULL,rn [Formula] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,rn [remark] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,rn [OrderNO] [int] NULL,rn [Flag] [char](1) COLLATE Chinese_PRC_CI_AS NULL,rn [DeletedFlg] [char](1) COLLATE Chinese_PRC_CI_AS NULL,rn [OpID] [int] NULL,rn [OpDate] [datetime] NULLrn) ON [PRIMARY]rnrnGOrnSET ANSI_PADDING OFFrnrnrnrnrnrn哪位大神能给个建议 或思路呀 没有多少分了 见谅
求大神指点指点!
我现在用asp.net 写一个采集。 rnrn有300多个城市 每个城市基本都有2400多条数据。rnrn我想采集起来快一点。 请问有什么好的办法吗!rnrn因为中间还要分析页面上的数据。采集图片等等。 所以速度相对比较慢rnrn那位大神能给点这样的思路或者代码。rn
求大神指点指点
我的是Ubuntu18.04系统;rn里面有docker,我想要把容器挂载到宿主机,报错“mount.nfs: access denied by server while mounting 192.168.0.1:/nfsdisk/”rn请大神们指点一下,这个问题怎么解决;
关于并发的问题。求指点
假如一个用户对一个投标程序同时投标,虽然我在提交的时候做了判断,判断这个标是否已经满额了。rn如果一个标只能投500了,同时有2个用户对这个标都投500,就会有问题。rn虽然这样的情况的概率非常低,但是如何避免这样的情况发生呢?
spring 并发问题 求大神指点! 鞠躬!! 鞠躬!! 再鞠躬!!
public class SpringBeanUtil implements ApplicationContextAwarern rn private static ApplicationContext applicationContext;rn*****/以下省略rn我自己写了一个工厂类来getBean(String beanName);rn现在设计的是页面web多个请求 rncontroller层没有使用spring的注入 而是直接 SpringBeanUtil.getBean("beanName").insert*rn这样子每次使用的getBean都是同一个对象,会出现并发问题吗?rn怎么解决
求大神解救!ajax的问题!
我想问一下,ajax的button点击事件,同时执行插入数据库和刷新局部页面,为什么有时候刷新会失效,有时候第一次点击不会刷新,第二次就可以了,这是什么原因?
AJAX问题。求大神解决!
[img=https://img-bbs.csdn.net/upload/201608/12/1470985160_350918.png][/img]rnrn跳转页面后。地址栏有参数。怎么才能使地址栏没有参数呢?求大牛解答
MyEclipse连接MySQL连不上,求大神指点!!!!!!!
RT,,,,[img=https://img-bbs.csdn.net/upload/201507/22/1437571162_709124.png][/img]rn然后这是出错为地方。。。rn[img=https://img-bbs.csdn.net/upload/201507/22/1437571209_674102.png][/img]rn完全想不通啊,,URL有问题???
DruidDataSource 配置mysql,启动报错,求大神指点
地址信息:rnjdbc.driver=com.mysql.jdbc.Driverrnjdbc.url=jdbc:mysql://localhost:3306/order?characterEncoding=UTF-8rnjdbc.username=rootrnjdbc.password=123456rnjdbc.initSize=5rnjdbc.maxActive=10rnjdbc.maxIdle=5rnjdbc.minIdle=2rnjdbc.maxWait=1000rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn 启动报错:org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'122.225.88.154' (using password: YES)rn 122.225.88.154都不知道是哪里的地址,我已经蒙了,求大神指点
mysql启动不了,求大神指点,感激不尽!
2017-10-09T01:42:06.484929Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid endedrn2017-10-09T01:42:42.000990Z mysqld_safe Starting mysqld daemon with databases from /opt/mysql/datarn2017-10-09T01:42:42.157912Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).rn2017-10-09T01:42:42.157977Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabledrn2017-10-09T01:42:42.157996Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.16-log) starting as process 21895 ...rn2017-10-09T01:42:42.161194Z 0 [Note] InnoDB: PUNCH HOLE support not availablern2017-10-09T01:42:42.161213Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtinsrn2017-10-09T01:42:42.161216Z 0 [Note] InnoDB: Uses event mutexesrn2017-10-09T01:42:42.161220Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrierrn2017-10-09T01:42:42.161228Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3rn2017-10-09T01:42:42.161230Z 0 [Note] InnoDB: Using Linux native AIOrn2017-10-09T01:42:42.161378Z 0 [Note] InnoDB: Number of pools: 1rn2017-10-09T01:42:42.161442Z 0 [Note] InnoDB: Using CPU crc32 instructionsrn2017-10-09T01:42:42.181498Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128Mrn2017-10-09T01:42:42.186230Z 0 [Note] InnoDB: Completed initialization of buffer poolrn2017-10-09T01:42:42.187139Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().rn2017-10-09T01:42:55.945202Z 0 [Warning] InnoDB: 1048576 bytes should have been read. Only 917504 bytes read. Retrying for the remaining bytes.rn2017-10-09T01:43:09.891588Z 0 [Warning] InnoDB: Retry attempts for reading partial data failed.rn2017-10-09T01:43:10.079210Z 0 [ERROR] InnoDB: [b]Tried to read 1048576 bytes at offset 2097152, but was only able to read 917504[/b]rn2017-10-09T01:43:10.079224Z 0 [ERROR] InnoDB: Operating system error number 5 in a file operation.rn2017-10-09T01:43:10.079236Z 0 [ERROR] InnoDB: Error number 5 means 'Input/output error'rn2017-10-09T01:43:10.079241Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.htmlrn2017-10-09T01:43:10.079246Z 0 [ERROR] InnoDB: File (unknown): 'read' returned OS error 105. Cannot continue operationrn2017-10-09T01:43:10.079250Z 0 [ERROR] InnoDB: Cannot continue operation.rn2017-10-09T01:43:10.384121Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
jsp连接mysql异常,求大神指点
<%@ page language="java" contentType="text/html; charset=utf-8"rn pageEncoding="utf-8"%>rn<%@ page import="java.util.*,java.text.*" %>rn<%@ page import="javax.sql.*,javax.naming.*,webbook.util.*" %>rn<%@ page import="java.sql.*,com.mysql.jdbc.Driver" %>rn<% String context=request.getContextPath(); %>rnrnrn guestbookrnrnrnString driverName="com.mysql.jdbc.Driver";rnString url = "jdbc:mysql://127.0.0.1:8080/test?useUnicode=true&characterEncoding=UTF-8";rnString username = "root";rnString password = "xiaopu123";rnString sql="insert into guestbook(id,name,email,phone,title,content,time) values (gb_seq.nextval,?,?,?,?,?,?)";rnint result=0;rnConnection conn=null;rnrequest.setCharacterEncoding("utf-8");rnString name = request.getParameter("name");rnString title = request.getParameter("title");rntryrnrn Class.forName(driverName);rn conn=DriverManager.getConnection(url,username,password);rn PreparedStatement pstmt = conn.prepareStatement(sql);rn pstmt.setString(1, StringUtil.filterHtml(name));rn pstmt.setString(2, request.getParameter(request.getParameter("email")));rn pstmt.setString(3, request.getParameter(request.getParameter("phone")));rn pstmt.setString(4, StringUtil.filterHtml(title));rn pstmt.setString(5, request.getParameter("content"));rn SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ddhh:mm:ss");rn pstmt.setString(6, sdf.format(new java.util.Date()));rn result = pstmt.executeUpdate();rn pstmt.close();rn catch (ClassNotFoundException e)rn e.printStackTrace();rn out.println("!");rn catch(SQLException e)rn e.printStackTrace();rn out.println("无法连接数据库,请检查数据库连接是否正确!");rn rnif(result==0)rn out.println("对不起,添加留言不成功,请您重新输入! ");rn out.println("添加新的留言内容 ");rn elsern out.println("祝贺您,成功添加留言。 ");rn out.println("查看所有留言内容 ");rn rn rn%>rn rn rnCopyright © 2016 baidu.comrnrnrnrnrnrn错误信息:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failurernrnPS:mysql-connector-java.jar包已经放在lib目录下,classpath也配置好了,求大神指点啊啊啊啊啊啊啊rnrn
求大神指点 驱动问题
本人是vxworks新手,在看驱动程序是出现两处代码不理解求大神给指点一下:rn第一处是:return((int)pxxDevHdr);pxxDevHdr是一个设备标示符结构体变量,我是想问这个结构体前面加上int限定之后其值是应该怎么看。rn还有:SIO_CHAN * pSioChan;rnxx_CHAN * pxxChan=(xx_CHAN *)pSioChan;rn这个算是结构体变量类型的转换吗?求大神给解释。
求大神指点布局管理器问题
import java.awt.BorderLayout;rnimport java.awt.Container;rnimport javax.swing.JButton;rnimport javax.swing.JFrame;rnrnpublic class p268rnrn public static void main(String args[])rn rn JFrame app=new JFrame("边界布局管理器");rn app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn app.setSize(360,130);rn Container c=app.getContentPane();rn c.setLayout(new BorderLayout(3,3));rn c.add(new JButton("东"),BorderLayout.EAST);rn c.add(new JButton("西"),BorderLayout.WEST);rn c.add(new JButton("南"),BorderLayout.SOUTH);rn c.add(new JButton("北"),BorderLayout.NORTH);rn c.add(new JButton("中"),BorderLayout.CENTER);rn app.setVisible(true);rn rnrn这个例子的结果是[img=https://img-bbs.csdn.net/upload/201310/18/1382109127_565311.jpg][/img]rn但是我想让东和西的按钮延长到边框,让南北夹在中间,谁知道如何实现?
求大神指点,登录验证问题
$.ajax(rn url:'login.do',rn type:'post',rn dataType:'json',rn data:userName:$('#username').val(),pwd:$('#pwd').val(),rn success:function(data)rn alert('00');rn if(data.result=='success')rn alert('success');rn window.location.href="./index.html";rn rn else if(data.result=='notExist')rn alert('用户名错误!');rn elsern alert('密码错误!');rn rn ,rn error:function(data)rn alert('服务器繁忙,稍后重试!');rn rn );rnrn//后台rn @RequestMapping("/login.do")rn rn public @ResponseBody Map login(@ModelAttribute("user")User userrn ,HttpServletRequest req)rn System.out.println(user.getUserName()+":"+user.getPwd());rn boolean b=false;rn Map data = new HashMap();rn try rn b = userservice.checkUser(MD5.GetMD5Code(user.getUserName()),rn MD5.GetMD5Code(user.getPwd()));rn catch (UserNameNotExistException e) rn data.put("result","notExist");rn System.out.println(e.getMessage());rn return data;rn rn if(b) //登录成功,设置session属性rn System.out.println("controller");rn HttpSession s =req.getSession();rn s.setMaxInactiveInterval(30);rn s.setAttribute("username", "Exist");rn data.put("result", "success");rn return data;rn rn else rn data.put("result","error");rn return data;rn rn rn问题:ie浏览器开了调试,能正常运行,关闭调试,就没反应了,360浏览器直接走了error:function 为什么,求大神指教!!
GC问题。求大神指点。
一个方法返回一个比较大的List对象,如果再调用它时不用变量接收它的返回值,那么这个方法返回的对象会被GC回收吗,在什么时候回收呢?有什么工具能看内存的变化吗?
求大神指点,地址问题
[img=https://img-bbs.csdn.net/upload/201305/10/1368179375_917265.jpg][/img]rn这是为什么呀??
C# 问题 求大神指点
我有两个打开的form,分别是form1和form2,我要实现,form2按下确认按钮的时候,把form2的textbox1的内容传到form1的textbox中然后关闭form2,我已经设置的静态全局变量,但是form1没有触发条件。请问如何解决?(ps:form1不要添加button来触发)
页面刷新问题,求大神指点
从数据库读出一组记录(比如说一组文件夹相关的信息 ) 在后台构建HTML代码 然后赋值给DIV (不是不想在前台JSON构建因为还有一些其他功能,JS太多了浏览器有点慢) 在构建的时候 给文件名字加个 onclick 事件 绑个keyid 在前台 点击事件的时候 用的是 httpRequest 提交本页面 后台也的确可以收到信息 并且查出文件夹 下一级的信息 并且构建HTML 问题来了: 页面不刷新,得不到新的信息 请各位指点下 是我用的方法不对,还是一定要拿到 httpRequest的responseText 在前台构建(前台太多JS 浏览器有点受不了) 或者有这种情况更好的解决办法 请大家 指点下
求大神指点window.showModalDialog问题
Response.Write(" ");rnrnResponse.Write(" ");rnrn求大神指点一下,上面的代码是登陆界面,登陆按钮点完,服务器验证完之后的代码,但是到看客户端,就报rnMicrosoft JScript运行时错误,拒绝访问。找了还久也没找出原因,应该是代码的原因,我把这段代码复制到其他程序中,返回客户端执行也是这个错误,求大神指点
java问题,求大神指点
求大神指点,下面两段代码FILEDEMO2里 new myfileflter 创建对象时为什么会自动调用该类中的accept方法?rn[img=https://img-bbs.csdn.net/upload/201801/14/1515893680_957309.png][/img][img=https://img-bbs.csdn.net/upload/201801/14/1515893755_98742.png][/img]
js问题,求大神指点!
rnrnrn```rn rnrn rn```rnrnrnrnrn这是一个传参数的方法,问题是:为什么ddd函数的参数,在不带单引号的时候,也就是如上代码的时候,alert出来的是2010106115268001500而不是2010106115268001565,而在个数字两边加上单引号的时候,alert出来的数据就是正常的呢?rn请大神指点,在线等
网页解析问题,求大神指点
我需要抓取一个网站的信息,通过抓包软件获取了验证码和一些关键参数,然后将参数拼到请求地址url中,在浏览器中直接打开这个url可以正常显示,抓包软件也显示了有返回数据,但是将此url放入程序中却解析不出数据,已经试过了jsoup直接解析、HttpClient和HttpURLConnection模拟浏览器访问等,都不行,会出现验证码错误页面(验证码直接访问没错而且我也没有再次请求新的验证码),或者是空的页面,求大神应该怎么办
求大神指点QAudioOutput问题
[color=#800000]QAudioOutput *m_audioOutput;rnRepletQIODevice *m_audioListenFile;rnm_audioOutput->start(m_audioListenFile);rnrn[/color]rnRepletQIODevice是我继承QFile创建一个新类,在这个类里面,我重现了readData(char *data, qint64 maxlen),让它读取我给它的数据来播放。memcpy(data, listenArray.left(maxlen).data(), maxlen);rn但是当我没有数据给data参数的时候,只要我调用m_audioOutput->stop(); 程序就会崩溃。求各位大虾指点迷津。
求大神指点,dll的问题
起初在xp上 VS2005制作了一个dll供一个软件运行,调用成功。 但是在另一个win7电脑上(没有VS)调用失败,没有读到dll,但是可以调用另一个dll,所以判断这个软件应该没问题。rn以为是操作系统版本问题。 后来在win7下重建dll项目生成,本机下可以调用,到其他电脑依然调用失败。rn这到底是什么原因?
校验的问题 求大神指点
[img=https://img-bbs.csdn.net/upload/201808/15/1534315123_616910.png][/img]rn前台页面输入code编码 存放在RSRV_STR8中 然后在修改编码时 判断编码是否存在 我写的这个逻辑对吗。。。。。为什么在修改时不判断啊 求大神指点
多线程问题,求大神指点
做了一个网络程序,底层用的是minarnrn有一个rn[code=java]rnpublic class MessageDispatcher rnrn private final Logger log = LoggerFactory.getLogger(MessageDispatcher.class);rnrn public MessageDispatcher() rn messageQueue = new ArrayBlockingQueue(2048);rn rn rn rn private BlockingQueue messageQueue;rn rn rnrn public int putMessage(String packet) rn rn try rn messageQueue.put(packet);rn catch (InterruptedException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn return 0;rn rnrn public String getMessage() rn try rn String packet = messageQueue.take();rn log.info("get message queue size:"+messageQueue.size());rn return packet;rn catch (InterruptedException e) rn log.error("get message error:" + e.getMessage());rn rn return null;rn rnrn[/code]rnMina 的client 收到到消息调用putMessage 方法rn然后又一个消息处理类rnrn[code=java]rnpublic class ServiceSkeleton rnrn private final Logger LOG = LoggerFactory.getLogger(ServiceSkeleton.class);rn private MessageThread messageThread;rn rn public ServiceSkeleton(MessageDispatcher dispatcher) rn this.dispatcher = dispatcher;rn rn rn rnrn public void start() rn messageThread=new MessageThread(dispatcher,this);rn messageThread.start();rn rnrn public void onMessage(String packet) rn System.out.println(packet);rn rn private MessageDispatcher dispatcher;rnrnclass MessageThread extends Thread rn private final Logger LOG = LoggerFactory.getLogger(MessageThread.class);rn boolean runFlag=true;rn public MessageThread(MessageDispatcher dispatcher,ServiceSkeleton sk)rn this.dispatcher=dispatcher;rn this.sk=sk;rn rn MessageDispatcher dispatcher;rn ServiceSkeleton sk;rn synchronized void setRunFlag(boolean flag)rn this.runFlag=flag;rn rn @Overridern public void run() rn while (true) rn LOG.info("get message from dispatcher!");rn String msg = dispatcher.getMessage();rn if (null != msg) rn tryrn sk.onMessage(msg);rn catch(Exception e)rn LOG.error("handler message error()",e.getMessage());rn rn rn rn rnrnrnrn[/code]rn这个类是处理消息的有多个实例,当消息量比较大的时候,不知道为什么会 ,Dispatcher队列里满了才会执行getMessage方法
求大神指点 上传图片问题
问题:我在本地用浏览器照相,在页面上保存了9个图片,全部显示好了。现在我要提交到服务器,input 的file没有办法赋值,怎么才能把这9个图片 在点击提交按钮的时候提交到服务器!!!!!!!
简单问题,求大神指点
[img=https://img-bbs.csdn.net/upload/201404/28/1398699834_937230.png][/img][img=https://img-bbs.csdn.net/upload/201404/28/1398699853_425511.png][/img]rn为什么参数传不过去啊,request中的paremeterMap中是空的,求指点
JQuery问题求大神指点
![图片说明](https://img-ask.csdn.net/upload/201512/09/1449639048_694821.jpg)n这个题是怎么做的???
javascript问题,求大神指点!!!
下面这段代码,为啥变量a的值还是javascript呢?不应该是全局变量么?和php的不一样么?求详解。谢谢rnrnrn rnrnrn rnrn
jvm的问题,求大神指点
class Testrnrn private static boolean done;rn public static void main(String[] args) rn rn System.out.println(done);rn new java.lang.Thread (new Runnable()rn public void run() rn while (!done)rn rn //这段代码不注释掉不会死循环,注释掉后,会进入循环,除非,在结尾使用System.exit(0);关掉jvm,这是为什么rn// System.out.println(1);rn rn rn rn ).start();rn try rn Thread.sleep(1000 * 5);rn catch (InterruptedException e) rn e.printStackTrace();rn rn done = true;rn System.out.println("this is end");rn// System.exit(0);rn rnrn
函数数组的问题,求大神指点指点
![图片说明](https://img-ask.csdn.net/upload/201711/02/1509635385_275677.jpg)rnrn![图片说明](https://img-ask.csdn.net/upload/201711/02/1509636869_875528.jpg)rnarr[0] ---------->>是这样加吗?这样写了没反应啊
本人初学ajax,求大神指点用ajax做分页
本人初学ajax,求大神指点用ajax做分页
求大神帮忙指点指点。
rn 现在碰到如下问题 、 需要查询几个平台下的全部店铺 (一个平台下有若干个店铺) 、使用如下语句 。rnrn[code=sql]rnSELECTrn `paipai_shop`.`sellerUin` AS `shopId`,rn `paipai_shop`.`shopName` AS `shopName`rnFROMrn `paipai_shop`rnUNION ALLrn SELECTrn `dangdang_shop`.`id` AS `shopId`,rn `dangdang_shop`.`shopName` AS `shopName`rn FROMrn `dangdang_shop`rn UNION ALLrn SELECTrn `vjia_shop`.`id` AS `shopId`,rn `vjia_shop`.`shopName` AS `shopName`rn FROMrn `vjia_shop`rn UNION ALLrn SELECTrn `amazon_shop`.`id` AS `shopId`,rn `amazon_shop`.`shopName` AS `shopName`rn FROMrn `amazon_shop`rn UNION ALLrn SELECTrn `taobao_shop`.`shopId` AS `shopId`,rn `taobao_shop`.`nick` AS `shopName`rn FROMrn `taobao_shop`rn UNION ALLrn SELECTrn `jingd_shop`.`shopId` AS `shopId`,rn `jingd_shop`.`shopName` AS `shopName`rn FROMrn `jingd_shop`rn UNION ALLrn SELECTrn `yhd_shop`.`shopId` AS `shopId`,rn `yhd_shop`.`shopName` AS `shopName`rn FROMrn `yhd_shop`[/code]rn 查询出来后 、 因为不同平台下的店铺可能有相同的 shopId 、 导致页面上相同shopid的店铺只显示一个条数据 。 求有无解决方法 。 rn rn rn 我曾经尝试给不同平台下的店铺shopid 后面 拼接 数字 譬如 :[color=#FF0000]`yhd_shop`.`shopId`+0[/color] AS `shopId` 结果 没有用 。哪位大神给个解决方法?
ajax 取值问题,求指点
[img=https://img-bbs.csdn.net/upload/201602/16/1455589405_387767.png][/img][img=https://img-bbs.csdn.net/upload/201602/16/1455589671_545652.png][/img]
一个ajax的问题 求指点
$(function() rn $("form :button").click(function() rn [color=#FF0000] var name = $("#name").val(); rn var age = $("#age").val();[/color] rn $.ajax( rn type: "POST", rn url: "user/addUser", rn data: name:name , age:age, rn success:function(data) rn alert("名字:" + data.name + "年龄:" + data.age); rn rn ); rn ); rn ); rn红色部分的.val()是啥意思啊
Ajax 求大神帮忙!
function updateTclass(){ var id = $("#classId1").val(); var tclassName = $("#className1").val(); var major = $("#classMajor1").val(); $.ajax({     type:"post",     url : "updateTclass.do",//访问
求大神指点哈
这个错误一直循环,怎么回事哦,能运行的项目都运行不起了,空项目都不能运行rn03-15 16:16:52.884 23816-23816/? A/Looper: Thread identity changed from 0x276000004fcf to 0x276000005d08 while dispatching to android.os.Handler com.qihoo.appstore.e@2ef8850e what=0rn03-15 16:16:52.886 23816-23816/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!rn03-15 16:16:52.889 23816-23816/? E/ServiceManager: error in getServicern android.os.TransactionTooLargeExceptionrn at android.os.BinderProxy.transactNative(Native Method)rn at android.os.BinderProxy.transact(Binder.java:509)rn at android.os.ServiceManagerProxy.getService(ServiceManagerNative.java:123)rn at android.os.ServiceManager.getService(ServiceManager.java:55)rn at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:2503)rn at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:2501)rn at android.util.Singleton.get(Singleton.java:34)rn at android.app.ActivityManagerNative.getDefault(ActivityManagerNative.java:91)rn at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:399)rn at android.util.Log$1.onTerribleFailure(Log.java:104)rn at android.util.Log.wtf(Log.java:294)rn at android.util.Log.wtf(Log.java:256)rn at android.os.Looper.loop(Looper.java:220)rn at android.os.HandlerThread.run(HandlerThread.java:61)rn03-15 16:16:52.894 23816-23816/? E/AndroidRuntime: Error reporting WTFrn java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.app.IActivityManager.handleApplicationWtf(android.os.IBinder, java.lang.String, boolean, android.app.ApplicationErrorReport$CrashInfo)' on a null object referencern at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:399)rn at android.util.Log$1.onTerribleFailure(Log.java:104)rn at android.util.Log.wtf(Log.java:294)rn at android.util.Log.wtf(Log.java:256)rn at android.os.Looper.loop(Looper.java:220)rn at android.os.HandlerThread.run(HandlerThread.java:61)rn03-15 16:16:52.895 23816-23816/? E/AndroidRuntime: Original WTF:rn android.util.Log$TerribleFailure: Thread identity changed from 0x276000004fcf to 0x276000005d08 while dispatching to android.os.Handler com.qihoo.appstore.e@2ef8850e what=0rn at android.util.Log.wtf(Log.java:291)rn at android.util.Log.wtf(Log.java:256)rn at android.os.Looper.loop(Looper.java:220)rn at android.os.HandlerThread.run(HandlerThread.java:61)rn03-15 16:16:53.188 23814-23814/? A/Looper: Thread identity changed from 0x276000004fcf to 0x276000005d06 while dispatching to android.os.Handler com.qihoo.appstore.e@2ef8850e what=0rn03-15 16:16:53.189 23814-23814/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!rn03-15 16:16:53.191 23814-23814/? E/ServiceManager: error in getServicern android.os.TransactionTooLargeExceptionrn at android.os.BinderProxy.transactNative(Native Method)rn at android.os.BinderProxy.transact(Binder.java:509)rn at android.os.ServiceManagerProxy.getService(ServiceManagerNative.java:123)rn at android.os.ServiceManager.getService(ServiceManager.java:55)rn at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:2503)rn at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:2501)rn at android.util.Singleton.get(Singleton.java:34)rn at android.app.ActivityManagerNative.getDefault(ActivityManagerNative.java:91)rn at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:399)rn at android.util.Log$1.onTerribleFailure(Log.java:104)rn at android.util.Log.wtf(Log.java:294)rn at android.util.Log.wtf(Log.java:256)rn at android.os.Looper.loop(Looper.java:220)rn at android.os.HandlerThread.run(HandlerThread.java:61)rn03-15 16:16:53.195 23814-23814/? E/AndroidRuntime: Error reporting WTFrn java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.app.IActivityManager.handleApplicationWtf(android.os.IBinder, java.lang.String, boolean, android.app.ApplicationErrorReport$CrashInfo)' on a null object referencern at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:399)rn at android.util.Log$1.onTerribleFailure(Log.java:104)rn at android.util.Log.wtf(Log.java:294)rn at android.util.Log.wtf(Log.java:256)rn at android.os.Looper.loop(Looper.java:220)rn at android.os.HandlerThread.run(HandlerThread.java:61)rn03-15 16:16:53.196 23814-23814/? E/AndroidRuntime: Original WTF:rn android.util.Log$TerribleFailure: Thread identity changed from 0x276000004fcf to 0x276000005d06 while dispatching to android.os.Handler com.qihoo.appstore.e@2ef8850e what=0rn at android.util.Log.wtf(Log.java:291)rn at android.util.Log.wtf(Log.java:256)rn rn
求大神指点!谢谢
[img=https://img-bbs.csdn.net/upload/201312/10/1386654407_153499.jpg][/img]我想实现如图中间游戏房间那一块界面。但是还差点什么呢?求大神指点,label button上的图片还没加上去rn程序如下:rnimport javax.swing.JButton;rnimport javax.swing.JFrame;rnimport javax.swing.JLabel;rnrnpublic class ScendGui extends JFrame rn private static int num = 1;rn private int jb_size=40;rn private int jl_size=45;rn private int fgap = 20;//行间隔rn private int fgap2 = 20;//列间隔rn private int rgap = 35;//两房间间隔rn private int mgap =2*jb_size+jl_size+rgap; //两桌子间隔rn private int fjb2gap = fgap+jl_size+jb_size;//jb2的首距离rn private int fjlgap = fgap+jl_size; //jl的首距离rn public ScendGui(String s)rn super(s);rn rn this.setLocation(100, 100);rn this.setSize(600, 600);rn for(int i = 1;i<=5;i++)rn for(int j= 0;j<=2;j++)rn rn JButton jb1= new JButton("椅子");rn jb1.setBounds(fgap+j*mgap, fgap2, jb_size, jb_size);rn JButton jb2= new JButton("椅子"); rn jb2.setBounds(fjb2gap+j*mgap, fgap2, jb_size, jb_size);rn JLabel jl= new JLabel("桌子");rn jl.setBounds(fjlgap+j*mgap, fgap2,jl_size, jl_size);rn String str = Integer.toString(num); rn JLabel label = new JLabel("-"+str+"-");rn num = Integer.parseInt(str);rn label.setBounds(mgap/2+j*mgap, 2*jb_size, 20, 20);rn this.add(jb1);rn this.add(jb2);rn this.add(jl);rn this.add(label);rn rn num++;rn fgap2 = (fgap2+2*jb_size)*i+20;rn rn this.setVisible(true);rn rn rn rn public static void main(String[] args) rn new ScendGui("游戏大厅");rnrn rnrnrn
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview