java


How am I able to do nonTransactedWork in Hibernate 5 like I did in Hibernate 3?


I am working with two databases. (oracle and postgresql) Since oracle is a DDL (Data Definition Language) I'm having trouble getting my sql query to be executed when I am running oracle.
In hibernate 3 I was using isolator.doNonTansactedWork to get around this:
private void execute(String sql) {
if (dialect.isOracle()) {
Isolater.doNonTransactedWork(new IsolatedWork() {
#Override
public void doWork(Connection connection) {
try {
connection.createStatement().execute(sql);
}
catch (SQLException e) {
throw new RuntimeException(e);
}
}
}, (SessionImplementor)session());
}
else {
session().createSQLQuery(sql).executeUpdate();
}
}
Now in hibernate 5 there is no support for Isolater. I don't really know how to get around this problem. I asked a question before about Isolater specifically here: Is there a replacement for Isolater (Hibernate 3.6) in Hibernate 4.x and above?
It is correct but it isnt exactly what I want. I want to know a way to have nonTransactionalWork again or even if it's still possible in hibernate 5.
Right now I'm using session().createSQLQuery(sql).executeUpdate() for hibernate 5. This only works with postgresql but I want to be able to use oracle as well.

Related Links

What does my argument need to be in my java program?
Spawning a child window in JavaFX
What driver to use with Groovy/Gradle to Connect to an Oracle Database
Get only TimeZone field from new Date() in java
JAVA: how to input data into a Hashtable using a scanner?
How to configure Spring Security with already existing WebApplicationInitializer?
how to get the array output from a js function in java 8?
Why is my JDBCBrokerFactory growing
Hibernate cross-field validation for integers?
Android Display over 1 mb pdf file inside a layout
Storing files to MySQL using jdbc code
Adding using Images GUI
Not able to delete pdf created by iText
Pass by value vs pass by reference in java [duplicate]
How to display a two dimensional array as a hierarchy table in java?
Java: Is there a way to call a method while the original method terminates? [closed]

Categories

HOME
compiler-construction
asp.net-core
netsuite
netbeans
oracle11g
plot
include
lodash
electron
rsync
sqlite-net-extensions
google-oauth
yarn
malloc
rubygems
youtube-api-v3
win32gui
google-project-tango
autotools
append
offline
correlation
resize
windows-server-2012
propel
scichart
nas
amazonsellercentral
tokenize
css-animations
google-search-api
microsoft-r
lcd
qhull
django-storage
pingfederate
phpfox
fgetcsv
srcset
twilio-api
google-qpx-express-api
repo
mmenu
bower-install
bytecode-manipulation
io-redirection
file-format
main
angularjs-factory
tasker
grid.mvc
angular2-meteor
cubic-spline
skeleton-css-boilerplate
long-polling
youcompleteme
hendrix
jlink
rdfs
svmlight
nativeapplication
diagnostics
composite-key
django-scheduler
cubes
slicknav
google-web-starter-kit
nsfilemanager
essence
sdf
netmq
jfugue
prerequisites
thredds
twirl
composite
proj4js
operator-precedence
nstableviewcell
angularjs-ng-click
winddk
mdt
google-reader
navigationservice
reactfx
mcts
html5-notifications
opcache
excel-2003
batterylevel
trusted
rdoc
tridion-worldserver
invite
xtype
locationlistener
netbeans-7.1
lang
infrastructure
mozilla-prism
nhibernate.search
ncqrs
user-friendly
webkit.net
privilege
genealogy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App