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

JDBC SQLServerException Parameter not defined
Do i need to create new Callable object for each thread?
Impossible to find or load the main class (good classpath, good manifest, good class)
JProgressBar doesn't update as expected in Java [duplicate]
Replace all characters in a string that are between two other characters in Java
Java File walkFileTree, missing the hidden file attribute
I'm using Netbeans, and I'm getting an UnsatisfiedLinkError
How to get Application Name Using Package Name(Assuming i already have the package name) [duplicate]
Vertex ID updation in Titan DB
Hibernate doubles foreign key in one-to-many
Spring mongo query collection on property with underscore char
JavaFX And Sockets: Chatroom Glitchy, works sometimes
#Transient not working with #ElementCollection on same field
Represent a circle in a geodesic spatial
Open file dialog window in jsf [duplicate]
List<String> is getting printed as a plain String in toString method for DTO

Categories

HOME
winforms
mediawiki
push-notification
kde
include
relayjs
android-4.4-kitkat
youtube-dl
rsync
v8
fancybox
paradox
elasticsearch-hadoop
kibana-4
commonmark
orchardcms
visual-studio-2005
messages
windows-server-2012
ups
decimal
graphlab
introduction
immutable.js
cx-freeze
autoconf
intentfilter
devops
restful-authentication
claims-based-identity
cas
django-storage
uninstall
spring-mybatis
key-value-observing
subset-sum
form-data
android-nestedscrollview
language-concepts
wallpaper
normal-distribution
bower-install
io-redirection
uft-api
document.write
opshub
ncalc
heightmap
outlook-api
modelmapper
convertapi
fault
apache-fop
paxos
jlink
mu
forever
pg-dump
media-player
sqldf
gnome-shell-extensions
specrun
vmware-tools
paypal-express
master-slave
dataview
livequery
ipconfig
hsv
qdialog
tarjans-algorithm
ionic
composite
directoryservices
gwidgets
knuth
project-planning
google-reader
has-many-through
poller
rtmfp
ril
sharp-repository
android-hardware
pvrtc
browser-detection
google-email-migration
windows-phone-7.1.1
reddot
eclipse-templates
php-parser
window-management
hirefire
xmlspy
rfc1123
html-input
fluent-interface
blitz++
database-management
multi-tier
swing-app-framework
simpletest
private-members
dbisam

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