commit

postgresql: \copy method enter valid entries and discard exceptions

谁都会走 提交于 2019-12-20 03:25:12
问题 When entering the following command: \copy mmcompany from '<path>/mmcompany.txt' delimiter ',' csv; I get the following error: ERROR: duplicate key value violates unique constraint "mmcompany_phonenumber_key" I understand why it's happening, but how do I execute the command in a way that valid entries will be inserted and ones that create an error will be discarded? 回答1: The reason PostgreSQL doesn't do this is related to how it implements constraints and validation. When a constraint fails

how to list all pull request with count of files changed

拈花ヽ惹草 提交于 2019-12-20 03:08:58
问题 I am looking for some command which tells me number of files committed in a single pull request. I would like to know count of files in a single pull request individual from beginning. Question explained in real life scenario: Let's say for some myProject someone raised a pull request number 100 which has changes in 15 files. I am looking for a command which list all pull request from 1 to 100 with count of changed files. Please answer wrto Windows 7. i.e. PR Number 100 has changes in 10

Spring @Transactional rollbackFor not working

爷,独闯天下 提交于 2019-12-20 02:52:37
问题 I have a code like below public abstract class AffltTransactionService implements IAffltTransactionService { .... @Override @Transactional public void processTransactions(List<? extends AffltTransaction> transactions) { for (AffltTransaction transaction : transactions) { if (transaction != null) { processTransaction(transaction); } } } private void processTransaction(AffltTransaction transaction) { try { processTransactionInternal(transaction); } catch (Exception exception) {

Java more than one DB connection in UserTransaction

£可爱£侵袭症+ 提交于 2019-12-20 02:34:22
问题 static void clean() throws Exception { final UserTransaction tx = InitialContext.doLookup("UserTransaction"); tx.begin(); try { final DataSource ds = InitialContext.doLookup(Databases.ADMIN); Connection connection1 = ds.getConnection(); Connection connection2 = ds.getConnection(); PreparedStatement st1 = connection1.prepareStatement("XXX delete records XXX"); // delete data PreparedStatement st2 = connection2.prepareStatement("XXX insert records XXX"); // insert new data that is same primary

how to format commit message for some people in git hook?

时间秒杀一切 提交于 2019-12-19 11:56:22
问题 people should add bug ID in commit message in some format,such as [BUG33] [review leader=...] ... and not every committer must have to follow this formula,i mean scm can write free in commit message. i have searched that commit-msg hook may help to implement it. any one can git me some similar hook examples 回答1: The book progit has an excellent example of these, both server-side and client-side. You can find a few examples here. One example taken from that link and adapted to your commit

How does mysqli::commit & mysqli::rollback work?

浪尽此生 提交于 2019-12-19 03:42:27
问题 I've read the online php manual but I'm still not sure of the way these two functions work: mysqli::commit & mysqli::rollback. The first thing I have to do is to: $mysqli->autocommit(FALSE); Then I make some queries: $mysqli->query("..."); $mysqli->query("..."); $mysqli->query("..."); Then I commit the transaction consisting of these 3 queries by doing: $mysqli->commit(); BUT in the unfortunate case in which one of these queries does not work, do all 3 queries get cancelled or do I have to

GIT: commit changes to old/safe branch while in new/dirty/dev branch without checking out or losing unstaged data

[亡魂溺海] 提交于 2019-12-18 15:13:08
问题 I created a new Branch before I started dev on something experimental. I usually forget that (which isn't a problem), but now I did it beforehand. Since then I have updated 3 files. In 2 are only experimental changes that I DON'T want committed to the safe branch. In 1 are only safe (minor) changes that I definitely DO want committed to the safe branch. I'm fine with these last changes to be committed to the new branch as well (but rather not). Is it possible - I'm sure it is - to (quickly)

How to get (only) author name or email in git given SHA1?

你离开我真会死。 提交于 2019-12-18 14:09:01
问题 I would like to check for author's e-mail and name, surname to verify who's pushing to my repo. Is there any way that I can come up with a command in git to show commiter's name/e-mail given only SHA1 of the commit? This is what I came up with but it's far from ideal solution (the first solution is for git hook that's why it's using 2 SHA1s with rev-list . The second one simply uses git show ): git rev-list -n 1 --pretty=short ccd3970..6ddf170 | grep Author | cut -d ' ' -f2- | rev | cut -d '

Atomically set SERIAL value when committing transaction

前提是你 提交于 2019-12-18 13:09:40
问题 Say I have a table where I want to use a serial as primary key to ask for changes from the client. The client will ask "give me the changes after key X". Without using SERIALIZABLE isolation level or locking, this is prone to race conditions. Transaction A can start first, and do its writes, then take a long time to commit. Meanwhile transaction B will start and commit, before A commits. The write from B will get a higher primary key than the write from A. If a client now asks for changes it

GIT Error:- expected committer email '' but found 'karan@xyz.com'

一个人想着一个人 提交于 2019-12-18 12:18:09
问题 Git push is getting rejected with the following error message: expected committer email '' but found 'karan@xyz.com' I have already tried: setting use properties in .gitconfig file. trying git push making different clones of same repository. setting up whole system all together after formatting it. But none has worked. What else can I do to resolve it. 回答1: This doesn't seem like a git limitation, but should be some kind of pre-receive hook on the remote side (the Git repository hosting