Questions tagged [database-integrity]

48 questions
2
votes
3 answers

How to avoid data insertion if an error occurs? (method with several insertions) in Laravel

I am building a web application and I am aware of a possible problem. I have a controller in which I have a store method. This method creates several insertions in the database. public function store(LocationPostRequest $request) { $location =…
Jeremy
  • 1,756
  • 3
  • 21
  • 45
2
votes
2 answers

Hibernate Spring: @ManyToMany DataIntegrityViolationException ConstraintViolationException

I am building a sample for ManyToMany relationship between: User(1) - ()AccessLevel() - (1)Role I have implemented 3 classes in Java with hibernate implementation as follow: Class User @Entity @Table(name="user") public class User { @Id …
Cristian Colorado
  • 2,022
  • 3
  • 19
  • 24
2
votes
1 answer

django: IntegrityError: duplicate key value violates unique constraint

I had this problem when I try to save a new entry into a table called 'config', class Config(models.Model): ident = models.CharField(max_length=uuidLength, null=True, editable=False) scanner = models.ForeignKey('Scanner') name =…
Shang Wang
  • 24,909
  • 20
  • 73
  • 94
1
vote
2 answers

H2 Database : Cannot parse "DATE" constant "31-JAN-20" while inserting a new record

Consider the following DDL I am using to create an H2 database table in one of my JUnit test cases : CREATE TABLE "CONFIG_INFO" ( "ID" VARCHAR2(12 BYTE), "RUN_DATE" DATE, ); The class that I am writing a unit test for tries to…
Ping
  • 587
  • 5
  • 27
1
vote
3 answers

Question about composite primary keys

Example table: Ticket - id - tenant_id - foo TicketItem - id - tenant_id - ticket_id - bar Assuming that id and tenant_id on each table make up composite primary keys, and that ticket_id is a foreign key to Ticket will…
orokusaki
  • 55,146
  • 59
  • 179
  • 257
1
vote
2 answers

Foreign key constraint should be complaining but somehow it's not

I have, among others, three tables: account, address and account_address. The account_address table has an account_id and an address_id. It's your standard many-to-many relationship. I have a perplexing situation where I have an account_address…
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
1
vote
0 answers

Magento 1 to Magento 2 | Data-Migration-Tool | Integrity Check + Offset

I would like to migrate data from Magento 1 to Magento 2 with Data-Migration-Tool. (I’m working on a local windows machine with wamp) Magento 1 —> v1.6.0.0 Magento 2 —> v2.1.2 I’ve got many errors during the data migration. (Ok for the settings…
1
vote
1 answer

Is there in KDB/Q any way to check integrity of a partitioned table?

Is there in KDB/Q any way to check integrity of a partitioned table? Thank you very much for your help!
S.V
  • 2,149
  • 2
  • 18
  • 41
1
vote
3 answers

MySQL Multi-Insert? MySQL DB integrity after failed INSERT

Is it possible to insert a row into multiple tables at once? If you do several tables related by an ID; what is the best way to ensure integrity is maintained in case an INSERT fails?
KeatsKelleher
  • 10,015
  • 4
  • 45
  • 52
1
vote
1 answer

SQL Integrity constraint violation: 1062 Duplicate entry

When I'm updating products in my Magento-store externally from my accounting software I'm receiving following error in the logs: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '727-0-4-0' for key…
user2002046
  • 63
  • 1
  • 8
1
vote
0 answers

SQL: Trying to understand how to use safely access and modify database concurrently

So, I'm working in MySQL at the moment, but any SQL answers will probably do, cuz I'm trying to understand the general concepts. So thread safety is obviously important in concurrent environments. I program primarily in Java and I'm always extremely…
craigmiller160
  • 5,751
  • 9
  • 41
  • 75
1
vote
2 answers

Integrity constraint violation while importing products in magento

I am trying to import products in magento through a csv file. I got this error while importing the file. please suggest me how resolve this error I got the following error SQLSTATE[23000]: **Integrity constraint violation: 1452** Cannot add or…
Bharat Jain
  • 500
  • 3
  • 15
1
vote
2 answers

django - current transaction is aborted, commands ignored until end of transaction block

try: user = User.objects.create_user(_username, _email, pwd) except IntegrityError, e: fail = e.message return render_to_response('register.html',{'reg_fail':fail},context_instance=RequestContext(request)) I have this code, once i catch…
doniyor
  • 36,596
  • 57
  • 175
  • 260
1
vote
3 answers

How to handle deletion in relational databases?

If a relational database has, for example, a table Suppliers, where values of Suppliers.ID are used in columns of other tables such as Invoice.Supplier, what should happen if a user wants to "remove Supplier 15 from the system"?
CJ7
  • 22,579
  • 65
  • 193
  • 321
1
vote
3 answers

How to go about catching database and software version mismatch on deployed application?

I'm developing a standalone application that accesses a common database on a server. It will be used by a few dozen people in my organization. I know that I will need to update the software and the design of the database. This creates the…
John
  • 15,990
  • 10
  • 70
  • 110