forked from headius/jibernate
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Piotr Gega (pietia)
committed
Sep 30, 2011
1 parent
7d150db
commit 79e1987
Showing
1 changed file
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pietia be careful using session.connection directly, in a connection pool environment the session will return a new connection, consider to use a createSQLQuery instead.
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ops sorry Pietia, update are supported only in HQL, but I don't know if will be possible generate a HQL with the sql received.
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we should try to @mkristian's work ( http://docs.jboss.org/hibernate/core/3.6/javadocs/org/hibernate/Session.html#doWork(org.hibernate.jdbc.Work) )
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, Hibernate doWork will help us.
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tomorrow...
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pietia we can consider to create UpdateWork in Ruby and avoid a jar dependency inside of Jibernate. What do you think?
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can do something like that:
session.do_work do |connection|
connection.createStatement()
...
end
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but what about pooling ? AFAIR Hibernate doesn't support something like:
getCurrentConnection
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JRuby will create a Work interface implementation in Runtime and call 'execute' method passing a connection, the implementation of 'execute' method will be the Ruby code block.
Take look in Closure Conversion:
https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby
79e1987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll commit a implementation.