mysql中before触发器对同一张表的同一个数据进行update操作的执行次序

是这样的,萌新现在正在学习mysql触发器,在Navicat Premium上验证before触发器功能的时候发现了以下问题:

首先我建了一张学生表内容如下:
图片说明

然后我设置一个before触发器如下:

图片说明

即当进行update操作的时候,就将学生的名字改为"小白"

然后我又写了一条sql语句,更新sid=1的学生名字为"小黑"

图片说明

但执行的结果却是:

图片说明

本萌新记得before触发器是先完成触发,再增删改,触发的语句先于监视的增删改。那么按理说,我觉得我以上的操作结果应该是:

    监听到update语句--->触发器触发--->sid=1的学生名字变为小白--->继续执行update语句--->sid学生名字变为小黑。这样才对。

    可为什么,最后的结果却是小白,这不就相当于只执行了before触发器里的语句,sql语句里的uspdate操作没有生效吗?


    但是before触发器不是应该是先监听到监视语句,再触发,最后再执行监视语句吗?这不就跟它的概念不相符了吗?

百度了很久,也没找到想要的答案,在此跪求大佬解答,万分感谢

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
MySQL添加用户时报错,没有password字段

今天在菜鸟教程学mysql时,想往mysql 数据库中的 user 表添加新用户: 报错提示: > MySQL添加用户时报错 'ERROR 1054 (42S22): Unknown column 'password' in 'field list'' ``` INSERT INTO user ( host, user, password, select_priv, insert_priv, update_priv) VALUES ('localhost', 'guest', PASSWORD('123456'), 'Y', 'Y', 'Y'); ``` 而我 DESCRIBE user; 后发现确实没有password这个字段 请问该如何解决?

MySQL使用PHP将DATETIME更新为NOW()

<div class="post-text" itemprop="text"> <p>This all worked before I added the section to update "last_update". </p> <pre><code>if((time() - $last_update) &gt; 7200){ $sql = $dbh-&gt;prepare("UPDATE item_list SET quantity=:quantity, price=:price, last_update=:now WHERE item_name=:itemname"); $sql-&gt;bindParam(':quantity', $json-&gt;volume); $sql-&gt;bindParam(':price', $json-&gt;lowest_price); $sql-&gt;bindParam(':itemname', $row['Item_Name']); $sql-&gt;bindParam(':now', "NOW()"); //This doesn't work $sql-&gt;execute(); } </code></pre> <p>When this is called I want to make last_update the date and time now. In the database it is currently a DATETIME, and when I last_update I origianly set them to NOW();</p> <p>Doing this I get the error <strong>Fatal error: Cannot pass parameter 2 by reference in.... Directory</strong></p> <p>I know it expects a variable, I'm not sure how to fix it though. I tried setting </p> <p><code>$now = "NOW()"; $sql-&gt;bindParam(':now', $now);</code> </p> <p>No prevail. Any help?</p> </div>

使用PHP的PDO MYSQL准备更新语句未执行

<div class="post-text" itemprop="text"> <p>I am trying to execute a prepared statement using a PDO via PHP on a MySQL database.</p> <p>I have tried two versions of the code both have not worked. The function update will execute but nothing will get updated in the database. My view customerData functions using fetch() and fetchAll() both work as does my deleteData function.</p> <p>My current database structure is:</p> <pre><code>customerID(int11) firstName(varchar(50) lastName(varchar(50) address(varchar(50) city(varchar(50) state(varchar(50) postalCode(varchar(20) countryCode(char(2) phone(varchar(20) email(varchar(50) password(varchar(20) </code></pre> <p>The current version of code I am using:</p> <pre><code>function update_customer($customerID, $firstName, $lastName, $address, $city, $state, $postalCode, $countryCode, $phone, $email, $password) { global $db; $query = "UPDATE customers SET firstName = :first, lastName = :last, address = :add, city = :c, state = :s, postalCode = :postal, countryCode = :country, phone = :p, email = :e, password = :password WHERE customerID = :ID"; $statement = $db-&gt;prepare($query); $statement-&gt;bindValue(':first',$firstName); $statement-&gt;bindValue(':last', $lastName); $statement-&gt;bindValue(':add', $address); $statement-&gt;bindValue(':c' ,$city); $statement-&gt;bindValue(':s',$state); $statement-&gt;bindValue(':postal', $postalCode); $statement-&gt;bindValue(':country',$countryCode); $statement-&gt;bindValue(':p', $phone); $statement-&gt;bindValue(':e', $email); $statement-&gt;bindValue(':pass', $password); $statement-&gt;bindValue(':ID', $customerID); $statement-&gt;execute(); $statement-&gt;closeCursor(); } </code></pre> <p>The other version of code I have used</p> <pre><code>function update_customer($customerID, $firstName, $lastName, $address, $city, $state, $postalCode, $countryCode, $phone, $email, $password) { global $db; $query = "UPDATE customers SET firstName = ?, lastName = ? address = ?, city = ?, state = ?, postalCode = ?, countryCode = ?, phone = ?, email = ?, password = ? WHERE customerID = ?"; $statement = $db-&gt;prepare($query); $statement-&gt;bindParam('ssssssssssi', $firstName, $lastName, $address, $city, $state, $postalCode, $countryCode, $phone, $email, $password, $customerID); $statement-&gt;execute(); $statement-&gt;closeCursor(); } </code></pre> <p>My other 3 prepared statements work perfectly, for example here is the prepared statement that populates the update customer form.</p> <pre><code>function view_customerData ($customerID) { global $db; $query = "SELECT * FROM customers WHERE customerID = $customerID"; try { $statement = $db-&gt;prepare($query); $statement-&gt;execute(); $customerData = $statement-&gt;fetch(); return $customerData; } catch (PDOException $e) { $error_message = $e-&gt;getMessage(); echo "&lt;p&gt;Database error: $error_message &lt;/p&gt;"; exit(); } } </code></pre> </div>

Mysql 错误代码: 在 MySQL Workbench UPDATE 过程中的1175

<div class="post-text" itemprop="text"> <p>I'm trying to update the column <code>visited</code> to give it the value 1. I use MySQL workbench, and I'm writing the statement in the SQL editor from inside the workbench. I'm writing the following command:</p> <pre><code>UPDATE tablename SET columnname=1; </code></pre> <p>It gives me the following error:</p> <blockquote> <p>You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option ....</p> </blockquote> <p>I followed the instructions, and I unchecked the <code>safe update</code> option from the <code>Edit</code> menu then <code>Preferences</code> then <code>SQL Editor</code>. The same error still appear &amp; I'm not able to update this value. Please, tell me what is wrong?</p> </div> <p>转载于:https://stackoverflow.com/questions/11448068/mysql-error-code-1175-during-update-in-mysql-workbench</p>

java执行SQL脚本!!!!!

今天第一次用 java 执行sql脚本,是不是sql.out里边如果没东西就意味着成功?可我执行完成后表数据全都建好了 但是 sql.out里边显示的内容是这些 我需要做个判断 显示 是否成功 ,这个判断要怎么做?(重点是怎么才能根据sql.out里边的信息 来判断是否执行成功 )

通过使用Node作为json从MySQL获取blob图像并将其打印到PHP中

<div class="post-text" itemprop="text"> <p>I'm trying to make a basic image like this :</p> <pre><code>&lt;img src='myImage' /&gt; </code></pre> <p>It's easy yeah ? But my image is stored as a blob in my MySQL BDD.<br> Already easy yeah ? the answer is <a href="https://stackoverflow.com/questions/20556773/php-display-image-blob-from-mysql">here</a>.<br> -&gt;Nope because I'm getting my SQL lines by Node sending it to my PHP as a JSON file. So the PHP will receive an array (The image is an array with a lot of numbers and the PHP's function named "base64_encode" need a String as paramater, and not an Array). I have to convert this array to an image to print it. But i don't find how to.</p> <p>Anybody know ?</p> <p>Image to explain <a href="https://i.stack.imgur.com/ue4d7.png" rel="nofollow noreferrer">here</a>.<br> var_dump($myImg) -&gt;</p> <pre><code>array(25890) { [0]=&gt; int(137) [1]=&gt; int(80) [2]=&gt; int(78) [3]=&gt; int(71) [4]=&gt; int(13) [5]=&gt; int(10) [6]=&gt; int(26) [7]=&gt; int(10) [8]=&gt; int(0) [9]=&gt; int(0) [10]=&gt; int(0) [11]=&gt; int(13) [12]=&gt; int(73) [13]=&gt; int(72) [14]=&gt; int(68) [15]=&gt; int(82) [16]=&gt; int(0) [17]=&gt; ... </code></pre> </div>

mybatis 执行 INSERT … ON DUPLICATE KEY UPDATE

mybatis 在执行 INSERT … ON DUPLICATE KEY UPDATE 格式的语句的时候 没有报错,库表也没插入数据,数据库是mysql 用mysql客户端执行这条语句的时候却是能插入的 是因为myBatis不支持吗? 语句示例: INSERT INTO test (main_id,score,totalCount) VALUES (123,5.0,12345) ON DUPLICATE KEY UPDATE score=VALUES(score), totalCount=VALUES(totalCount) main_id是主键,以上语在mysql客户端执行能正确插入或更新 <insert id="insertOrUpdate" parameterType="这里就不写了"> INSERT INTO test (main_id,score,totalCount) VALUES (456,5.0,12345) <!--这里有个参数是456,同上面一条的123不一样--> ON DUPLICATE KEY UPDATE score=VALUES(score), totalCount=VALUES(totalCount) </insert> 这是mybatis里面执行的语句,为了直观些,我直接写了一条死语句进来。 同样的两条语句,在mybatis里面执行的时候也不报错,但是数据库却插不进去,也不能更新 求解!

update语句的set后面不能有分组函数怎么解决?

![图片说明](https://img-ask.csdn.net/upload/201707/20/1500518045_294472.png)update set sal=avg(sal) from emp where job='CLARK'; 题为将emp表中job值为CLARK的员工的薪水改为所有员工的平均薪水

创建运动员表失败SQLSTATE [23000]:完整性约束违规:

<div class="post-text" itemprop="text"> <p>i am trying to create to 2 tables and inserting data into them but i am geting this error <strong>Creating Athlete the table failed SQLSTATE[23000]: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails</strong></p> <pre><code>try { $dropQuery = "DROP TABLE IF EXISTS Country"; $pdo-&gt;exec($dropQuery); $dropQuery = "DROP TABLE IF EXISTS Athlete"; $pdo-&gt;exec($dropQuery); $createQuery = "CREATE TABLE Country ( countryID int(11) NOT NULL AUTO_INCREMENT, name varchar(30) NOT NULL, population decimal(10,0), flagImage varchar(30) NOT NULL, PRIMARY KEY (countryID) )"; $pdo-&gt;exec($createQuery); } catch(PDOException $e) { $error = " Creating Country the table failed"; include 'error.php'; exit(); } try { $createQuery = "CREATE TABLE Athlete ( athleteId int(11) NOT NULL AUTO_INCREMENT, lastName varchar(30) NOT NULL, firstName varchar(30) NOT NULL, gender char(1) NOT NULL, image varchar(300) NOT NULL, sport varchar(30) NOT NULL, countryID int(11) NOT NULL, CONSTRAINT Athlete_Country FOREIGN KEY (countryID) REFERENCES Country(countryID), PRIMARY KEY (athleteId) )"; $pdo-&gt;exec($createQuery); } catch(PDOException $e) { $error = " Creating Athlete the table failed"; include 'error.php'; exit(); } try { $query = "INSERT INTO Country (name,population,flagImage) VALUES ('usa',324206000,'usa.jpg')"; $pdo-&gt;exec($query); $query = "INSERT INTO Country (name,population,flagImage) VALUES ('Hungary',9823000,'hungary.jpg')"; $pdo-&gt;exec($query); $query = "INSERT INTO Country (name,population,flagImage) VALUES ('Jamaica',2930050,'jamaica.jpg')"; $pdo-&gt;exec($query); $query = "INSERT INTO Country (name,population,flagImage) VALUES ('United Kindom',65341183,'uk.jpg')"; $pdo-&gt;exec($query); $query = "INSERT INTO Country (name,population,flagImage) VALUES ('Australia',25054000,'australia.jpg')"; $pdo-&gt;exec($query); $query = "INSERT INTO Country (name,population,flagImage) VALUES ('South Africa',54956900,'southafrica.jpg')"; $pdo-&gt;exec($query); $query = "INSERT INTO Country (name,population,flagImage) VALUES ('Ethiopia',92206005,'ethiopia.jpg')"; $pdo-&gt;exec($query); $query = "INSERT INTO Country (name,population,flagImage) VALUES ('Poland',38437239,'poland.jpg')"; $pdo-&gt;exec($query); $query = "INSERT INTO Country (name,population,flagImage) VALUES ('China',1379442000,'china.jpg')"; $pdo-&gt;exec($query); } catch(PDOException $e) { $error = "Creating Country data failed"; include 'error.php'; exit(); } try { $query = "INSERT INTO Athlete VALUES (1,'Phelps','Michael','m','Phelps.jpg','Swimming',1)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (2,'Ledecky','Katie','f','Ledecky.jpg','Swimming',1)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (3,'Biles','Simone','f','Biles.jpg','Gymnastics',1)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (4,'Hosszu','Katinka','f','Hosszu.jpg','Swimming',2)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (5,'Bolt','Usain','m','Bolt.jpg','Athletics',3)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (6,'Kenny','Jason','m','Kenny.jpg','Cycling',4)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (7,'Danuta','Kozak','f','Danuta.jpg','Canoeing',2)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (8,'Murphy','Ryan','m','Murphy.jpg','Swimming',5)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (9,'Manuel','Simone','f','Manuel.jpg','Swimming',1)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (10,'Dirado','Maya','f','Dirado.jpg','Swimming',1)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (11,'van Niekirk','Wayde','m','vanNiekirk.jpg','Athletics',6)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (12,'Ayana','Almaz','f','Ayana.jpg','Athletics',7)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (13,'Wlodarczyk','Anita','f','Wlodarczyk.jpg','Athletics',8)"; $pdo-&gt;exec($query); $query = "INSERT INTO Athlete VALUES (14,'Long','Qingquan','m','Long.jpg','Weightlifting',9)"; $pdo-&gt;exec($query); } catch(PDOException $e) { $error = "Creating Athlete the data failed"; include 'error.php'; exit(); } </code></pre> </div>

JPA 实现修改的时候有问题(Could not execute JDBC batch updat)

我先从数据库查一条记录,修改的时候调用以下save方法 public String save() { if (StringUtils.isNotBlank(this.id)) { this.model = (T) this.manager.get(this.id); } if (null != this.model) { this.model = (T) this.manager.save(this.model); this.addActionMessage("save entity sucessfully!"); } else { this.addActionError("entity to save is null!"); return Action.INPUT; } return Action.SUCCESS; } [color=red]后台报错[/color] 56828 [http-8080-1] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1062, SQLState: 23000 56828 [http-8080-1] ERROR org.hibernate.util.JDBCExceptionReporter - Duplicate entry '2009062316522976530' for key 'PRIMARY' 56828 [http-8080-1] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) [b]问题补充:[/b] [color=red]save调用这个方法[/color] public T save(T object) { Assert.notNull(object, "entity不能为空"); if (null == object.getId()) { object.setId(String.valueOf(PKgen.getInstance().nextPK())); } return this.jpaTemplate.merge(object); } [b]问题补充:[/b] 118235 [http-8080-6] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1062, SQLState: 23000 118235 [http-8080-6] ERROR org.hibernate.util.JDBCExceptionReporter - Duplicate entry '2009062316522976530' for key 'PRIMARY' 118235 [http-8080-6] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54) at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:456) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy22.save(Unknown Source) at com.ruling.base.web.struts2.action.BaseCRUDAction.save(BaseCRUDAction.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.BatchUpdateException: Duplicate entry '2009062316522976530' for key 'PRIMARY' at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1666) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1082) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ... 85 more [ERROR] 2009-06-23 18:59:55,687 [freemarker.log.Log4JLoggerFactory$Log4JLogger.error(Log4JLoggerFactory.java:96)] Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update The problematic instruction: ---------- ==> ${msg[0]} [on line 68, column 29 in org/apache/struts2/dispatcher/error.ftl] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136) at freemarker.ext.beans.SimpleMethodModel.get(SimpleMethodModel.java:146) at freemarker.core.DynamicKeyName.dealWithNumericalKey(DynamicKeyName.java:111) at freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKeyName.java:90) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IfBlock.accept(IfBlock.java:82) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:172) at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IfBlock.accept(IfBlock.java:82) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:232) at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:703) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NullPointerException at freemarker.ext.beans.BeansWrapper.unwrapArguments(BeansWrapper.java:573) at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:109) ... 42 more 2009-6-23 18:59:55 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet default threw exception java.lang.IllegalStateException at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407) at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:707) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) [b]问题补充:[/b] if (StringUtils.isNotBlank(this.id)) { this.model = (T) this.manager.get(this.id); } [color=red]这里我已删除了,才报错[/color] [b]问题补充:[/b] ywbanm: [color=red]我是先get出来 在修改属性 再merge [/color] 后台老是报这个错误::::::::: [color=red]WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1062, SQLState: 23000 783391 [http-8080-5] ERROR org.hibernate.util.JDBCExceptionReporter - Duplicate entry '2009062323162784330' for key 'PRIMARY' 783391 [http-8080-5] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update[/color] 能有什么办法解决吗 [b]问题补充:[/b] sql 语句 为:insert 怎样做才变成update 问题补充: [DEBUG] 2009-06-26 13:26:28,640 [org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource.getTransactionAttribute(AbstractFallbackTransactionAttributeSource.java:107)] Adding transactional method [save] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] Hibernate: insert into T_MODULE (DATECREATED, DATEMODIFED, DELETED, NAME, REMARK, OPTLOCK, HREF, HREFTARGET, LEAF, LEVEL, PARENTID, QTIP, TEXT, UIPROVIDER, DESCRIPTION, MODULENAME, URL, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 114829 [http-8080-6] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1062, SQLState: 23000 114829 [http-8080-6] ERROR org.hibernate.util.JDBCExceptionReporter - Duplicate entry '2009062611061317130' for key 'PRIMARY' 114829 [http-8080-6] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

jenkins执行shell命令时,命令被分成两行执行,中间有一个管道,怎么办?

命令是这个 ``` find -name '*.jsp'|xargs perl -pi -e 's|ccc.com|aaa.com|g' ``` 在控制台输出是这样的 ``` + cd + find -name '*.jsp' + xargs perl -pi -e 's|ccc.com|aaa.com|g' ``` 怎么样让它在一行执行呢?

C#中update 更新语句中遇到的问题

string sql = string.Format("update tb_Addressbook set Name = '" + Address_1.Text + "',Sex='" + Address_2.Text + "',Phone = '" + Address_3.Text + "',QQ='" + Address_4.Text + "',WordPhoe ='" + Address_5.Text + "',E_Mail='" + Address_6.Text + "',Handset='" + Address_7.Text + "' where ID =" + Store.Address_ID); 其中 Store.Address_ID静态字段,存放的是查询表中的ID所获得的值 SqlHelper.SqlExecuteNonQuery(sql, CommandType.Text); 其他信息: 违反了 PRIMARY KEY 约束“PK__tb_Addre__3214EC27A6EE7F9C”。不能在对象“dbo.tb_AddressBook”中插入重复键。重复键值为 (1)。

如何从php导出这个数据表到Excel文件

<div class="post-text" itemprop="text"> <p>can anyone here help with the code to export to an Excel file i hope that someone can because I already have an export button.</p> <p>I want to keep the most with this code because this code works well. and if you want to see the export.php ask for it.</p> <p>here a picture <a href="https://i.stack.imgur.com/o8XqW.png" rel="nofollow noreferrer">enter image description here</a></p> <pre><code>&lt;a class="btn btnx btn-orange" href="export.php" target="_new"&gt;&lt;i class="fa fa-download"&gt;&lt;/i&gt; Export to Excel&lt;/a&gt; &lt;div class="table-responsive"&gt; &lt;table id="mytable" class="table table-bordred table-striped"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;#&lt;/th&gt; &lt;th&gt;Auditeur&lt;/th&gt; &lt;th&gt;Afdeling&lt;/th&gt; &lt;th&gt;Invoerdatum&lt;/th&gt; &lt;th&gt;Week&lt;/th&gt; &lt;th&gt;Zone&lt;/th&gt; &lt;th&gt;Stand&lt;/th&gt; &lt;th&gt;Zijn alle overbodeige gereedschappen / materialen van de werkpost verwijderd / geïdentificeerd? ( sleutel, bouten / moeren,.... )&lt;/th&gt; &lt;th&gt;Opgeslagen foto nr1&lt;/th&gt; &lt;th&gt;Is er rommel aanwezig op de werkpost ( bekertjes, kledij, flesjes,....)&lt;/th&gt; &lt;th&gt;Opgeslagen foto nr2&lt;/th&gt; &lt;th&gt;Zijn vervallen / niet geautoriseerde documenten verwijderd?&lt;/th&gt; &lt;th&gt;Opgeslagen foto nr3&lt;/th&gt; &lt;th&gt;Opmerking&lt;/th&gt; &lt;th&gt;Edit&lt;/th&gt; &lt;th&gt;Delete&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;?php $fetchdata=new DB_con(); $sql=$fetchdata-&gt;fetchdata(); $cnt=1; while($row=mysqli_fetch_array($sql)) { ?&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo htmlentities($cnt);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Auditeur']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Afdeling']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['PostingDate']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Week']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Zone']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Stand']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['NOKOK01']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Results']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['NOKOK02']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Results2']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['NOKOK03']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Results3']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo htmlentities($row['Bericht']);?&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="updat_form_sortings.php?id=&lt;?php echo htmlentities($row['id']);?&gt;"&gt;&lt;button class="btn btn-info btn-xs"&gt;&lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt;&lt;/button&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="app_opslag_sorting.php?del=&lt;?php echo htmlentities($row['id']);?&gt;"&gt;&lt;button class="btn btn-danger btn-xs" onclick="return confirm('Wil je bestand echt verwijderen?');"&gt;&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;&lt;/button&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php // for serial number increment $cnt++; } ?&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>here is my export.php code</p> <pre><code>&lt;?php //export.php $connect = mysqli_connect("localhost", "root", "", "oopscrud02"); $output = ''; if(isset($_POST["export"])) { $query = "SELECT * FROM tblusers"; $result = mysqli_query($connect, $query); if(mysqli_num_rows($result) &gt; 0) { $output .= ' &lt;table class="table" bordered="1"&gt; &lt;tr&gt; &lt;th&gt;#&lt;/th&gt; &lt;th&gt;Afdeling&lt;/th&gt; &lt;th&gt;Invoerdatum&lt;/th&gt; &lt;th&gt;Week&lt;/th&gt; &lt;th&gt;Zone&lt;/th&gt; &lt;th&gt;Stand&lt;/th&gt; &lt;th&gt;Zijn alle overbodeige gereedschappen / materialen van de werkpost verwijderd / geïdentificeerd? ( sleutel, bouten / moeren,.... )&lt;/th&gt; &lt;th&gt;Opgeslagen foto nr1&lt;/th&gt; &lt;th&gt;Is er rommel aanwezig op de werkpost ( bekertjes, kledij, flesjes,....)&lt;/th&gt; &lt;th&gt;Opgeslagen foto nr2&lt;/th&gt; &lt;th&gt;Zijn vervallen / niet geautoriseerde documenten verwijderd?&lt;/th&gt; &lt;th&gt;Opgeslagen foto nr3&lt;/th&gt; &lt;th&gt;Opmerking&lt;/th&gt; &lt;/tr&gt; '; while($row = mysqli_fetch_array($result)) { $output .= ' &lt;tr&gt; &lt;td&gt;'.$row["Auditeur"].'&lt;/td&gt; &lt;td&gt;'.$row["Afdeling"].'&lt;/td&gt; &lt;td&gt;'.$row["PostingDate"].'&lt;/td&gt; &lt;td&gt;'.$row["Week"].'&lt;/td&gt; &lt;td&gt;'.$row["Zone"].'&lt;/td&gt; &lt;td&gt;'.$row["Stand"].'&lt;/td&gt; &lt;td&gt;'.$row["NOKOK01"].'&lt;/td&gt; &lt;td&gt;'.$row["Results"].'&lt;/td&gt; &lt;td&gt;'.$row["NOKOK02"].'&lt;/td&gt; &lt;td&gt;'.$row["Results2"].'&lt;/td&gt; &lt;td&gt;'.$row["NOKOK03"].'&lt;/td&gt; &lt;td&gt;'.$row["Results3"].'&lt;/td&gt; &lt;td&gt;'.$row["Bericht"].'&lt;/td&gt; &lt;/tr&gt; '; } $output .= '&lt;/table&gt;'; header('Content-Type: application/xls'); header('Content-Disposition: attachment; filename=Sorterend form.xls'); echo $output; } } ?&gt; </code></pre> </div>

sql语句报错,请大神看下哪里的错误

错误代码: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE ) ENGINE=INNODB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8' at line 15 ``` CREATE TABLE `task_schedule_job` ( `job_id` BIGINT(20) NOT NULL AUTO_INCREMENT, `create_time` TIMESTAMP NULL DEFAULT NULL, `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `job_name` VARCHAR(255) DEFAULT NULL, `job_group` VARCHAR(255) DEFAULT NULL, `job_status` VARCHAR(255) DEFAULT NULL, `cron_expression` VARCHAR(255) NOT NULL, `description` VARCHAR(255) DEFAULT NULL, `bean_class` VARCHAR(255) DEFAULT NULL, `is_concurrent` VARCHAR(255) DEFAULT NULL COMMENT '1', `spring_id` VARCHAR(255) DEFAULT NULL, `method_name` VARCHAR(255) NOT NULL, PRIMARY KEY (`job_id`), UNIQUE KEY `name_group` (`job_name`,`job_group`) USING BTREE ) ENGINE=INNODB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; ```

如何解决could not execute jdbc batch update?

如何解决could not execute jdbc batch update.本人是菜鸟不知道此问题那里出错,请教.谢谢!

tolua如何实现unity的update功能

tolua里面有个update 如何驱动他?协同程序 还是 while循环? 我看了c语言用while循环 但是 while循环不是很耗性能嘛? 难道是和unity进行交互? 但是每帧的交互 不也很耗性能嘛 所以 好奇 如何用lua实现定时器 或者说 实现 unity的 update的功能

当传递具有已修改行的datarow集合时,更新时要求有效的insertCommand

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace DataGridViewTest { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.dataGridView1.AllowUserToDeleteRows = true; } private void Form1_Load(object sender, EventArgs e) { // TODO: 这行代码将数据加载到表“tempdbDataSet.Class1”中。您可以根据需要移动或移除它。 this.class1TableAdapter.Fill(this.tempdbDataSet.Class1); } private void button1_Click(object sender, EventArgs e) { this.sqlDataAdapter1.Update(this.tempdbDataSet); } private void button2_Click(object sender, EventArgs e) { foreach (DataGridViewRow r in dataGridView1.SelectedRows) { dataGridView1.Rows.Remove(r); } } } } 点击按钮更新,也就是button1_Click的时候就会报这个错。insert 和delete都不行,要怎么解决?

tomcat异常终止,报错日志在下面,有没有大佬知道如何解决

``` Dec 06, 2017 10:59:49 PM com.mongodb.ConnectionStatus$UpdatableNode update WARNING: Server seen down: /:27017 - java.io.IOException - message: couldn't connect to [/17017] bc:java.net.SocketTimeoutException: connect timed out Dec 06, 2017 11:00:14 PM org.apache.coyote.http11.AbstractHttp11Processor process INFO: Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. Dec 06, 2017 11:00:29 PM com.mongodb.ConnectionStatus$UpdatableNode update WARNING: Server seen down: /:27017 - java.io.IOException - message: couldn't connect to [/1027017] bc:java.net.SocketTimeoutException: connect timed out Dec 06, 2017 11:00:49 PM com.mongodb.ConnectionStatus$UpdatableNode update WARNING: Server seen down: /17 - java.io.IOException - message: couldn't connect to [/117] bc:java.net.SocketTimeoutException: connect timed out Dec 06, 2017 11:01:09 PM com.mongodb.ConnectionStatus$UpdatableNode update WARNING: Server seen down: /017 - java.io.IOException - message: couldn't connect to [/10.117] bc:java.net.SocketTimeoutException: connect timed out Dec 06, 2017 11:01:50 PM com.mongodb.ConnectionStatus$UpdatableNode update WARNING: Server seen down: /10017 - java.io.IOException - message: couldn't connect to [/10.117] bc:java.net.SocketTimeoutException: connect timed out Dec 06, 2017 11:02:10 PM com.mongodb.ConnectionStatus$UpdatableNode update WARNING: Server seen down: /10.7017 - java.io.IOException - message: couldn't connect to [/10.017] bc:java.net.SocketTimeoutException: connect timed out Dec 06, 2017 11:02:50 PM com.mongodb.ConnectionStatus$UpdatableNode update WARNING: Server seen down: /10.15017 - java.io.IOException - message: couldn't connect to [/10.159.17] bc:java.net.SocketTimeoutException: connect timed out Dec 06, 2017 11:03:06 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["ht60"] Dec 06, 2017 11:03:07 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["09"] Dec 06, 2017 11:03:07 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina Dec 06, 2017 11:03:07 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/gochan] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Dec 06, 2017 11:03:07 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/gan] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Dec 06, 2017 11:03:07 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/ghan] appears to have started a thread named [pool-1-thread-1] but has failed to stop it. This is very likely to create a memory leak. Dec 06, 2017 11:03:07 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/guaochan] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Dec 06, 2017 11:03:07 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["htt0"] Dec 06, 2017 11:03:07 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp09"] Dec 06, 2017 11:03:07 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["h0"] Dec 06, 2017 11:03:07 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["a09"] ```

dynamoDB更新项目,获取ValidationException:提供的键元素与架构不匹配

<div class="post-text" itemprop="text"> <p>I have the following code:</p> <pre><code>func updateStatusInDynamoDB(svc dynamodbiface.DynamoDBAPI, tableName, bucketName, objectKey string) error { _, err := svc.UpdateItem(&amp;dynamodb.UpdateItemInput{ TableName: aws.String(tableName), Key: map[string]*dynamodb.AttributeValue{ "data": &amp;dynamodb.AttributeValue{ M: map[string]*dynamodb.AttributeValue{ "original": &amp;dynamodb.AttributeValue{S: aws.String(fmt.Sprintf("s3://%s/%s", bucketName, objectKey))}, }, }, }, UpdateExpression: aws.String("set job_status = :s"), ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ ":s": &amp;dynamodb.AttributeValue{S: aws.String(PROCESSED)}, }, }) return err } </code></pre> <p>where my entry in dynamoDB is like:</p> <pre><code>{ "data": { "original": "s3://api-prod-uploadbucket-***/uploads/www.domain.tld/provider/archive.csv" }, "job_status": "UPLOADED", "provider": "provider", "timestamp": "2019-03-18 15:52:22.075817398 +0000 UTC m=+0.079862916", "uuid": "7c571c46-22a5-4137-acdf-9d6bcdf06abb", "website": "www.domain.tld" } </code></pre> <p>but i get this error:</p> <pre><code>ValidationException: The provided key element does not match the schema </code></pre> <p>what is the correct way to select the record, when i am only passing <code>data.original</code>?</p> <p>any advice is much appreciated</p> </div>

如何将struts2标签的校验提示显示在右边,而不是现实在上面

如何将struts2标签的校验提示显示在右边,而不是现实在上面? [b]问题补充:[/b] 怎么定义?? 在右边定义了一个DIV它就会将校验信息显示在DIV里吗? [b]问题补充:[/b] 那就得看标签的定义文件 [b]问题补充:[/b] 找到了struts校验提示的js代码,此代码的大致意思是在控件上面增加一个tr显示校验错误信息。 谁能改下这段代码,把它改成右边显示校验信息 [code="javascript"] function addError(e, errorText) { try { // clear out any rows with an "errorFor" of e.id var row = e.parentNode.parentNode; var table = row.parentNode; var error = document.createTextNode(errorText); var tr = document.createElement("tr"); var td = document.createElement("td"); var span = document.createElement("span"); td.align = "center"; td.valign = "top"; td.colSpan = 2; span.setAttribute("class", "errorMessage"); span.setAttribute("className", "errorMessage"); //ie hack cause ie does not support setAttribute span.appendChild(error); td.appendChild(span); tr.appendChild(td); tr.setAttribute("errorFor", e.id);; table.insertBefore(tr, row); // updat the label too var label = row.cells[0].getElementsByTagName("label")[0]; label.setAttribute("class", "errorLabel"); label.setAttribute("className", "errorLabel"); //ie hack cause ie does not support setAttribute } catch (e) { alert(e); } } [/code] [b]问题补充:[/b] 这是没关系的,我提前预留一行都无所谓

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

CSDN:因博主近期注重写专栏文章(已超过150篇),订阅博主专栏人数在突增,近期很有可能提高专栏价格(已订阅的不受影响),提前声明,敬请理解!

CSDN:因博主近期注重写专栏文章(已超过150篇),订阅博主专栏人数在突增,近期很有可能提高专栏价格(已订阅的不受影响),提前声明,敬请理解! 目录 博客声明 大数据了解博主粉丝 博主的粉丝群体画像 粉丝群体性别比例、年龄分布 粉丝群体学历分布、职业分布、行业分布 国内、国外粉丝群体地域分布 博主的近期访问每日增量、粉丝每日增量 博客声明 因近期博主写专栏的文章越来越多,也越来越精细,逐步优化文章。因此,最近一段时间,订阅博主专栏的人数增长也非常快,并且专栏价

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

工作八年,月薪60K,裸辞两个月,投简历投到怀疑人生!

近日,有网友在某职场社交平台吐槽,自己裸辞两个月了,但是找工作却让自己的心态都要崩溃了,全部无果,不是已查看无回音,就是已查看不符合。 “工作八年,两年一跳,裸辞两个月了,之前月薪60K,最近找工作找的心态崩了!所有招聘工具都用了,全部无果,不是已查看无回音,就是已查看不符合。进头条,滴滴之类的大厂很难吗???!!!投简历投的开始怀疑人生了!希望 可以收到大厂offer” 先来看看网...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

MySQL性能优化(五):为什么查询速度这么慢

前期回顾: MySQL性能优化(一):MySQL架构与核心问题 MySQL性能优化(二):选择优化的数据类型 MySQL性能优化(三):深入理解索引的这点事 MySQL性能优化(四):如何高效正确的使用索引 前面章节我们介绍了如何选择优化的数据类型、如何高效的使用索引,这些对于高性能的MySQL来说是必不可少的。但这些还完全不够,还需要合理的设计查询。如果查询写的很糟糕,即使表结构再合理、索引再...

用了这个 IDE 插件,5分钟解决前后端联调!

点击上方蓝色“程序猿DD”,选择“设为星标”回复“资源”获取独家整理的学习资料!作者 |李海庆我是一个 Web 开发前端工程师,受到疫情影响,今天是我在家办公的第78天。开发了两周,...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

【高并发】高并发秒杀系统架构解密,不是所有的秒杀都是秒杀!

网上很多的文章和帖子中在介绍秒杀系统时,说是在下单时使用异步削峰来进行一些限流操作,那都是在扯淡! 因为下单操作在整个秒杀系统的流程中属于比较靠后的操作了,限流操作一定要前置处理,在秒杀业务后面的流程中做限流操作是没啥卵用的。

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

Java14 新特性解读

Java14 已于 2020 年 3 月 17 号发布,官方特性解读在这里:https://openjdk.java.net/projects/jdk/14/以下是个人对于特性的中文式...

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

疫情后北上广深租房价格跌了吗? | Alfred数据室

去年3月份我们发布了《北上广深租房图鉴》(点击阅读),细数了北上广深租房的各种因素对租房价格的影响。一年过去了,在面临新冠疫情的后续影响、城市尚未完全恢复正常运转、学校还没开学等情况下...

面试官给我挖坑:a[i][j] 和 a[j][i] 有什么区别?

点击上方“朱小厮的博客”,选择“设为星标”后台回复&#34;1024&#34;领取公众号专属资料本文以一个简单的程序开头——数组赋值:int LEN = 10000; int[][] ...

又一起程序员被抓事件

就在昨天互联网又发生一起让人心酸的程序员犯罪事件,著名的百度不限速下载软件 Pandownload PC 版作者被警方抓获。案件大致是这样的:软件的作者不仅非法盗取用户数据,还在QQ群进...

应聘3万的职位,有必要这么刁难我么。。。沙雕。。。

又一次被面试官带到坑里面了。面试官:springmvc用过么?我:用过啊,经常用呢面试官:springmvc中为什么需要用父子容器?我:嗯。。。没听明白你说的什么。面试官:就是contr...

太狠了,疫情期间面试,一个问题砍了我5000!

疫情期间找工作确实有点难度,想拿到满意的薪资,确实要点实力啊!面试官:Spring中的@Value用过么,介绍一下我:@Value可以标注在字段上面,可以将外部配置文件中的数据,比如可以...

Intellij IDEA 美化指南

经常有人问我,你的 IDEA 配色哪里搞的,我会告诉他我自己改的。作为生产力工具,不但要顺手而且更要顺眼。这样才能快乐编码,甚至降低 BUG 率。上次分享了一些 IDEA 有用的插件,反...

【相亲】96年程序员小哥第一次相亲,还没开始就结束了

颜值有点高,条件有点好

太厉害了,终于有人能把TCP/IP 协议讲的明明白白了

一图看完本文 一、 计算机网络体系结构分层 计算机网络体系结构分层 计算机网络体系结构分层 不难看出,TCP/IP 与 OSI 在分层模块上稍有区别。OSI 参考模型注重“通信协议必要的功能是什么”,而 TCP/IP 则更强调“在计算机上实现协议应该开发哪种程序”。 二、 TCP/IP 基础 1. TCP/IP 的具体含义 从字面意义上讲,有人可能会认为...

腾讯面试题: 百度搜索为什么那么快?

我还记得去年面腾讯时,面试官最后一个问题是:百度/google的搜索为什么那么快? 这个问题我懵了,我从来没想过,搜素引擎的原理是什么 然后我回答:百度爬取了各个网站的信息,然后进行排序,当输入关键词的时候进行文档比对……巴拉巴拉 面试官:这不是我想要的答案 我内心 这个问题我一直耿耿于怀,终于今天,我把他写出来,以后再问,我直接把这篇文章甩给他!!! 两个字:倒排,将贯穿整篇文章,也是面试官...

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问