-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate + other non hibernate db updates, serializable tx
PostPosted: Fri Jan 27, 2006 8:30 am 
Beginner
Beginner

Joined: Fri Apr 15, 2005 3:30 pm
Posts: 46
Location: Fortaleza, Brazil
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0.5

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.siemens.swa.domain.DistributionCenterSTC"
table="DISTRIBUTION_CENTER_STC"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
lazy="true"
batch-size="6">

<id
name="id"
column="DISTRIBUTION_CENTER_STC_ID"
type="java.lang.Long"
>
<generator class="native"/>
</id>

<property
name="modemModelSeries"
column="MODEM_MODEL_SERIES"
not-null="true"
type="java.lang.String"
unique="true"
/>

<property
name="inclusionDate"
column="INCLUSION_DATE"
not-null="true"
type="java.util.Calendar"
/>

<property
name="matricula"
column="MATRICULA"
type="java.lang.String"
/>

<property
name="action"
column="ACTION"
not-null="true"
type="java.lang.String"
/>

<property
name="stcMovementStatus"
column="STC_MOVEMENT_STATUS"
type="java.lang.Integer"
/>

<property
name="stcOperationStatus"
column="STC_OPERATION_STATUS"
type="java.lang.Integer"
/>

<property
name="dateUpdated"
column="DATE_UPDATED"
type="java.util.Calendar"
/>

</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
n/a
Full stack trace of any exception that occurs:
n/a

Name and version of the database you are using:
MySQL 4.1.15

The generated SQL (show_sql=true):
n/a

Debug level Hibernate log excerpt:
n/a

Hi all,

We have an existing Hibernate app. We have a new requirement to implement a table that can be written to by Hibernate AND another, non java/hibernate application.

My understanding is that Hibernate SessionFactory relies on the assumption that it's the only entity accesing the database. How can I allow another application to write to this database table - which maps to the hbm file above?

I'm under the impression that having a 'serializable transaction' isolation level set at the mysql level may help. However, we are _NOT_ running innodb. We have plans to migrate to mysql 5.0 .

Any help appreciated,
iksrazal


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 8:51 am 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
You should read about locking strategies in the reference and versioning

You should trust your session very little. You may consider to lock objects when you update them.

You should analyse your application to find out specific situations, where concurrency can be a problem.

serializable transaction could bring your dead locks and performance problems.

Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


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