Re: [h2] Unique index or primary key violation: PRIMARY KEY ON .PAGE_INDEX error

2015-05-23 Thread Thomas Mueller
Hi,

I think this issue was resolved in version 1.4.179, see the changelog entry:

   - Databases created with version 1.3.175 and earlier that contained
   foreign keys in combination with multi-column indexes could not be opened
   in some cases. This was due to a bugfix in version 1.3.176: Referential
   integrity constraints sometimes used the wrong index.

I suggest to use a recent version of H2, but append ;mv_store=false to
the database URL.

Worst case, you would need to export the database to a SQL script with an
old version, and re-created it from the script in the new version.

Regards,
Thomas

On Fri, May 22, 2015 at 6:18 PM, Carson carsonhuang2...@gmail.com wrote:

 Hi,

 I'm new to H2, and I'm working with an already existing H2 database. When
 I first run H2 Console and access the database, I manage to get in.
 However, after I disconnect, and try to re-access the database, the
 following error occurs:

 Unique index or primary key violation: PRIMARY KEY ON .PAGE_INDEX;
 SQL statement:
 ALTER TABLE PUBLIC.PPT_TEMPLATE ADD CONSTRAINT PUBLIC.CONSTRAINT_21
 FOREIGN KEY(ID_TEMPLATE) REFERENCES PUBLIC.PPT_TEMPLATE(ID_TEMPLATE)
 NOCHECK [23505-176]

 I would need to get a fresh copy of the db from my git to be able to
 're-access' the database.


 My URL is the following: jdbc:h2:C:\Users\carson\.db\PPT_DB;CIPHER=AES

 My H2 version is, I think 1.3.176 (it's the version I see on the H2
 console tab)

 Do you guys know why this is occurring?

 --
 You received this message because you are subscribed to the Google Groups
 H2 Database group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to h2-database+unsubscr...@googlegroups.com.
 To post to this group, send email to h2-database@googlegroups.com.
 Visit this group at http://groups.google.com/group/h2-database.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups H2 
Database group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Unique index or primary key violation: PRIMARY KEY ON .PAGE_INDEX error

2015-05-22 Thread Carson
Hi,

I'm new to H2, and I'm working with an already existing H2 database. When I 
first run H2 Console and access the database, I manage to get in. However, 
after I disconnect, and try to re-access the database, the following error 
occurs:

Unique index or primary key violation: PRIMARY KEY ON .PAGE_INDEX; 
SQL statement:
ALTER TABLE PUBLIC.PPT_TEMPLATE ADD CONSTRAINT PUBLIC.CONSTRAINT_21 FOREIGN 
KEY(ID_TEMPLATE) REFERENCES PUBLIC.PPT_TEMPLATE(ID_TEMPLATE) NOCHECK 
[23505-176] 

I would need to get a fresh copy of the db from my git to be able to 
're-access' the database.


My URL is the following: jdbc:h2:C:\Users\carson\.db\PPT_DB;CIPHER=AES

My H2 version is, I think 1.3.176 (it's the version I see on the H2 console 
tab)

Do you guys know why this is occurring?

-- 
You received this message because you are subscribed to the Google Groups H2 
Database group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.