DDC-290: OCI8 triggers Warnings on invalid SQL or DB failures (Integrity Constraints) #360

Closed
opened 2026-01-22 12:36:01 +01:00 by admin · 5 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 31, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @beberlei:

OCI8 has the sad behaviour to trigger PHP errors and warnings on failures in the driver. Other abstraction layers catch them using the scream operator (@) and check for the return values. Attached is a patch that does the same and then throws a newly created OCI8Exception.

Not fixing this behaviour makes it impossible to check for oci8 behaviour where the ORM relies on the database to detect errors (Unique Constraints for OneToMany Unidirectional relations for example).

Originally created by @doctrinebot on GitHub (Jan 31, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @beberlei: OCI8 has the sad behaviour to trigger PHP errors and warnings on failures in the driver. Other abstraction layers catch them using the scream operator (@) and check for the return values. Attached is a patch that does the same and then throws a newly created OCI8Exception. Not fixing this behaviour makes it impossible to check for oci8 behaviour where the ORM relies on the database to detect errors (Unique Constraints for OneToMany Unidirectional relations for example).
admin added the Bug label 2026-01-22 12:36:01 +01:00
admin closed this issue 2026-01-22 12:36:02 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 31, 2010):

Comment created by romanb:

Even though error supression with @ is ugly and slow, you're right that this is probably necessary. As long as we dont need to do that on every single oci function.

Feel free to apply the patch.

@doctrinebot commented on GitHub (Jan 31, 2010): Comment created by romanb: Even though error supression with @ is ugly and slow, you're right that this is probably necessary. As long as we dont need to do that on every single oci function. Feel free to apply the patch.
Author
Owner

@doctrinebot commented on GitHub (Jan 31, 2010):

Comment created by @beberlei:

I am not sure on which oci methods this is neccesary. Lets start with oci_execute ;-) I have the feeling though oci_commit might also be a candidate.

@doctrinebot commented on GitHub (Jan 31, 2010): Comment created by @beberlei: I am not sure on which oci methods this is neccesary. Lets start with oci_execute ;-) I have the feeling though oci_commit might also be a candidate.
Author
Owner

@doctrinebot commented on GitHub (Jan 31, 2010):

Comment created by @beberlei:

Fixed

@doctrinebot commented on GitHub (Jan 31, 2010): Comment created by @beberlei: Fixed
Author
Owner

@doctrinebot commented on GitHub (Jan 31, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 31, 2010): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/2e7e64d45e6bffe3f35d

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/2e7e64d45e6bffe3f35d - [10334_DDC290.diff](https://gist.github.com/2e7e64d45e6bffe3f35d#file-10334_DDC290-diff)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#360