I am working with your typical three layered application that has a presentation layer, a business layer, and a DAO layer. It is a Java web application that uses Spring MVC, Spring Security, and Spring's transaction management from the business layer down. It is communicating with an Oracle 10g database.
I have a business layer method called createDepartment. Inside this method I make two calls to the DAO layer to create the department and create a position for that department. Each time I do this, I get a parent key not found exception when an attempt is made to create the position. If I move createPosition up to the presentation layer (outside of the transaction management), it works.
I can duplicate this in Oracle's SQL Developer. If I create a department, I can't see that department until I close the connection and get a new one, so I can see why the position cannot be created. What makes this different than most SQL inserts is that the application is using Oracle's label security feature and all departments have a label assigned to them. So when a department is created, a new label is created.
How can I make the department visible in the connection that it is using to create it?