Oracle Virtual Desktop Infrastructure: Exception 'foreign key constraint fails' while trying to Delete a Template From Desktop Pool (Doc ID 1585338.1)

Last updated on MARCH 17, 2016

Applies to:

Oracle Virtual Desktop Infrastructure - Version 3.3 to 3.5.2 [Release 3.0]
Information in this document applies to any platform.

Symptoms

The Virtual Desktop Infrastructure (VDI) Administrator may receive an exception saying 'foreign key constraint fails' while trying to delete a Template from Desktop Pool.

The following entry provides an example reference of this event recorded within VDA's cacao logs:

Sep 5, 2013 3:43:28 PM com.sun.vda.service.core.jobs.Job run
WARNING: thr#87790 Job :Job[2233485]: DESTROY_DESKTOP for [XXX-Templates (DP1), DESKTOP_ID: 534] failed with an exception: class com.sun.vda.service.persistence.PersistenceException: javax.persistence.RollbackException: com.sun.vda.service.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`vda`.`t_template`, CONSTRAINT `fk_template_parent_id` FOREIGN KEY (`rev_parent_id`) REFERENCES `t_template` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION)
Error Code: 1451
Call: DELETE FROM t_template WHERE ((id = ?) AND (version = ?))
  bind => [551, 6]
Query: DeleteObjectQuery([id=551] class com.sun.vda.service.persistence.PersistentRevision)
Sep 5, 2013 3:43:28 PM com.sun.vda.service.core.jobs.DestroyDesktopJob run
FINER: thr#87790 THROW
com.sun.vda.service.persistence.PersistenceException: javax.persistence.RollbackException: com.sun.vda.service.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`vda`.`t_template`, CONSTRAINT `fk_template_parent_id` FOREIGN KEY (`rev_parent_id`) REFERENCES `t_template` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION)
Error Code: 1451
Call: DELETE FROM t_template WHERE ((id = ?) AND (version = ?))
  bind => [551, 6]

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms