-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: Call Stored precedure
PostPosted: Fri May 21, 2004 9:58 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Hi all,

I have a question about oracle and hibernate.
I want to know if it's possible to call stored precedure with hibernate and if the XMLType is well used in Hibernate.
Sorry if this question has been already posted...

Kind regards, thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:02 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
wait next release

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:04 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Maybe you'll implement it:) Anthony


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:04 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Come on guys, those answers are not helpful. Don't mention the next version in this forum until its actually here. For the user asking the question its as much value as "no" if you say "wait".

To answer the question: You can call a SP by using direct JDBC and SQL, with a connection() from the Hibernate Session. You can integrate a proprietary SQL datatype by writing a Hibernate custom UserType.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:08 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Ok thx a lot Christian.
I use this solution for the moment.
And do you thing that keep an Entity Bean is a good solution or it's better to call the SP with a JDBC call for the performance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:09 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I don't understand the question and I don't see how those two things are related.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:28 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Ok so let me explain more:) for the moment the application use Entity and Session EJB.
Entity bean call SP to update Oracle9 XMLType and it's work well.
My job is to realize architecture for the migration to Hibernate and I don't know if I keep the SP for updating the XMLType or if I change the DB schema and use another model without proprietary types.
I think the best way is to use a JDBC call like you said but I'm wonder if it's good to keep the Entity bean who call the SP.
I think it's a non-sense isnt'it? Because utility of Entity Ejb only for a SP only consume more memory and time?

But my boss think no:(


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:30 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
If you use an Entity Bean only to call some SP with a proprietary Oracle type, and this is a single or at least rare case in your application, then there is really no problem. You should worry about the other 99% of your system.

Write some trivial JDBC/SQL, hide it with a DAO, use Hibernate for the rest (possibly also behind a DAO). If you don't use any Entity Bean aspect (transaction semantics, remoteness, security, etc.), why use it at all?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:41 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
I'm agree with you Christian. At the start of this project this application doesn't need EJB at all. But my boss ask to use them.
The second version is to migrate to Hibernate after lot of problem all works well but now we have problem with XMLType and SP.
I propose to use JDBC call to solve problem but they say find a solution to call a SP troughout Hibernate.
I finded nothing about it so I want to be sure that is no possible before present my architecture.

Now I use only delegate, Session Facade who call Util clas with static methods to manage my POJO and JDBC calls for the XMLType.

No I'm sure:) thx a lot Christian.

kind regards.

If you have another suggestion tell me.

Have a nice day


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:44 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
There is currently no other solution than using a JDBC connection (you can get that from the Hibernate Session and stay inside the same database transaction). You will have a clear migration path to a POJO backed by a Stored Procedure persisteer in the next major Hibernate version, however.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 11:54 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Thanks all for your information on the forum without these I wasnt be able to finish my project at time...

Kind regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.