에 관심있는 사람들을위한, 내가 서비스 내에서 다음 호출하여 문제를 해결 한 :
/**
* createConnection creates a database connection using the java.sql.DriverManager
* The parameters used to make the connection are taken from the current session
* @return java.sql.Connection object
*/
Connection createConnection(){
oracle.jdbc.OracleConnection cnx = null
try {
sessionFactory?.currentSession?.doWork new Work(){
void execute(Connection c){
//convert the com.sun.proxy.$Proxy<nn> connection to Oracle
cnx = c.unwrap(oracle.jdbc.OracleConnection.class)
}
}
return cnx
}
catch (SQLException sqle){
RIMS.ConnectionService.log.error "Error in createConnection: ${sqle.message}"
}
return null
}
또한 추가 :
import org.hibernate.jdbc.Work
및
def sessionFactory
를 주입 sessionFactory 빈.
이 코드는 dataSource.groovy 파일이없는 플러그인에 포함되어 있으며 프로젝트에서 잘 작동합니다.