-->
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.  [ 1 post ] 
Author Message
 Post subject: Statelesssession and Oracle
PostPosted: Fri Apr 11, 2008 12:41 am 
Newbie

Joined: Mon Nov 05, 2007 4:44 pm
Posts: 9
Hibernate version:
3.2.5
Mapping documents:
<hibernate-mapping package="test">
<class name="Data" table="DATA">
<id name="id" column="ID" access="field" type="long">
<generator class="native"/>
</id>
<property name="value" type="string" length="256"
column="VALUE" access="field" not-null="false"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Data data = new Data("test value");
userTransaction.begin();
StatelessSession session = remoteSessionFactory.openStatelessSession();
session.insert(data);
userTransaction.commit();
session.close();

Name and version of the database you are using:
RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
JDBC driver: Oracle JDBC driver, version: 10.2.0.3.0
Dialect - Using dialect: org.hibernate.dialect.Oracle10gDialect

The generated SQL (show_sql=true):
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: insert into DATA (VALUE, ID) values (?, ?)

Question:
Isn't StatelessSession interface suppose to use JDBC level inserts? When using MS SQL, the behavior is as expected, only a single insert is created. In this case an extra select is generated for every insert, is there anyway to get around that?


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

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.