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.  [ 6 posts ] 
Author Message
 Post subject: help on saving
PostPosted: Mon Jul 12, 2004 8:27 pm 
Beginner
Beginner

Joined: Fri Jan 16, 2004 3:22 pm
Posts: 26
Hello,
i'm stating to use hibernate with ms sql server...
some time ago i used with postgresql.

retrevieng data from sql server has not been a problem, however invocation of save method is not working, yet the proper sql sentences are been generated:

Code:
Hibernate: insert into myTable (name, description, idUser) values (?, ?, ?) select SCOPE_IDENTITY()


but no register is created on the db, no exception thrown neither.
what could be the problem?

i must also mention some strange warning after the first data fetch,

Code:
19:08:40,359  WARN JDBCExceptionReporter:20 - SQL Warning: 0, SQLState:
19:08:40,359  WARN JDBCExceptionReporter:28 - [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to myBD
19:08:40,375  WARN JDBCExceptionReporter:20 - SQL Warning: 0, SQLState:
19:08:40,375  WARN JDBCExceptionReporter:28 - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed database context to 'myBD'.
19:08:40,375  WARN JDBCExceptionReporter:20 - SQL Warning: 0, SQLState:
19:08:40,437  WARN JDBCExceptionReporter:28 - [Microsoft][SQLServer 2000 Driver for JDBC]Language changed to us_english
19:08:40,437  WARN JDBCExceptionReporter:20 - SQL Warning: 0, SQLState:
19:08:40,437  WARN JDBCExceptionReporter:28 - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed language setting to us_english.



this is the only configuration (in adition to the .hbm.xml) i include, i'm using springframework.

<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.connection.url">jdbc:microsoft:sqlserver://server;DatabaseName=myDB;PortNumber=1433;User=***;Password=***;schema=dbo;catalog=myDB</prop>
<prop key="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</prop>
<prop key="hibernate.connection.username">***</prop>
<prop key="hibernate.connection.password">***</prop>
</props>
</property>


i'm confused about this strange (alt least, to me) behaviour, what i'm missing??

any help will be deeply appreciated.
Gerardo


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 7:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Are you doing transaction handling in your saving code? You should.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 11:26 am 
Beginner
Beginner

Joined: Fri Jan 16, 2004 3:22 pm
Posts: 26
ups, no i'm not.... thanks

i thought not setting up transaction was like using atomic trans

would it be too much to ask you to point me to some docs? :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 11:27 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
The Hibernate reference documentation has a chapter that is named "Transactions". Also start reading on transactions wrt your database documentation.

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 11:31 am 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
http://www.hibernate.org/hib_docs/refer ... tions.html
As christan has already mentioned.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 12:17 pm 
Beginner
Beginner

Joined: Fri Jan 16, 2004 3:22 pm
Posts: 26
thanks both of you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.