session 2 « Session « JPA Q&A





1. Best Practices - Where to do Session creation?    forum.hibernate.org

I've got a question regarding the best practices for where to do Session creation? The way I currently have the architecture setup is to have my Action classes (I'm using struts) call to a Manager layer (something like MemberManager). Within this layer is where all of the sessions are created for interacting with the DB. So I have a method called ...

2. Possible RFE: Session.updateProperty()?    forum.hibernate.org

I'm looking at the API for updating objects, and was wondering if there is a way to easily accomplish an update for a single property. For example, a method along the lines of: Session.updateProperty(Object foo, String property, Object value); Ideally, this mechanism would be smart enough to do things like throw a StaleObjectException if appropriate, etc. I can edit the operations ...

3. Using interface class with session.get(...)    forum.hibernate.org

4. About Session.isOpen() and Session.isConnected()    forum.hibernate.org

I have 2 questions about the Hibernate API 1. what is the difference between Session.isOpen() and Session.isConnected()? 2. Suppose I''m using JDBCConnection for Hibernate, when the connection is closed (by timeout, server shut down, or killed by others etc.), what should Session.isOpen() and Session.isConnected() return? I have an experience that if the connection is closed not through Hibernate, both two methods ...

5. Problems with session.iterate()!?    forum.hibernate.org

( ... ) if(Character.toUpperCase(tarefa) == 'C') { res_count = (Integer)session.iterate("select count(*) from vo.Mp mp where mp.referencia like upper('%?%') and mp.estado = 'A'", ref_padrao, Hibernate.STRING).next(); //-- (A) } else{ Query query = session.createQuery("from vo.Mp mp where mp.referencia like upper(:ref_padrao) and mp.estado = 'A' order by mp.referencia asc"); query.setParameter("ref_padrao", "%" + ref_padrao + "%"); ...

6. AssertionFailure: possible nonthreadsafe access to session?    forum.hibernate.org

I'm getting an AssertionException in my app: ----- net.sf.hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) net.sf.hibernate.AssertionFailure: possible nonthreadsafe access to session ----- What I'm trying to do is move an earlier inserted to another database, both of which are accessed via Hibernate. What I'm ...

7. Hibernate Session.seach() method    forum.hibernate.org

I am using Hibernate 2.1.2. The following is the code in question. Code: Session hibernateSession = HibernateManager.currentSession(); Criteria criteria = hibernateSession.createCriteria(Market.class); Example example = Example.create(requestMarket).excludeZeroes().ignoreCase().enableLike(); criteria.add(example); criteria.addOrder(Order.asc("marketName")); List marketList = criteria.list(); The Market object retrieves 900+ objects from the DB. The corresponding query output in stdout.log is as follows. Code: select market0_.MARKETID as MARKETID0_, market0_.MARKETNAME as MARKETNAME0_, market0_.NEWCODEVALUE as NEWCODEV3_0_, market0_.UPGRADECODEVALUE ...

8. Problem using Session.get()    forum.hibernate.org

I have a class A and 3 subclasses of A (B, C and D) persistent in the same table. Only the classes C and D implements a Interface Intf. At a certain point in my application I get a primary key of a entity which is a Implementation of Intf (dont know if is it a entity of type C or ...

9. Dynamically include new classes in the session    forum.hibernate.org

Hi, Is it possible (or planed to be) to add dynamically new classes in the session? I mean, for example, in an application, we could generate classes, mapping files and update the database to be able to add the new class just generated to the session. And use the new objects in the same execution time... Am I clear? In an ...





10. session disconnecting randomly    forum.hibernate.org

class A { static Session session; getWhatever() { S somethingManager = new S(session); somethingManager.executeSomething(); } } class S { static Session session; S(Session s) { session = s; } public void executeSomething() { Query q = .... ... ...

11. MBean restarting with each session    forum.hibernate.org

jboss.jca:service=RARDeployer jboss.jca:service=LocalTxCM,name=cellmera/core/DataSource java:/cellmera/core/HibernateFactory java:/cellmera/core/DataSource net.sf.hibernate.dialect.PostgreSQLDialect com/gosa/cellmera/core/classes/User.hbm.xml com/gosa/cellmera/core/classes/Role.hbm.xml com/gosa/cellmera/core/classes/Permission.hbm.xml ...

12. When do I have to discard the session and make a new one ?    forum.hibernate.org

I am reviewing my Hibernate code, and am getting quite tired of writing the same sort of close-session-get-another-one-in-case of exception. There are several situations where I assume that the Session instance remains intact : 1) Attempting to load a record that doesnt exist 2) Attempting to save a record that already exists 3) Attempting to delete a non existent record Is ...

13. First within session takes forever    forum.hibernate.org

Thanks for the answer. My guess would be that the connection fetching is responsible for this, since all other statements also have to be compiled, yet they are executed much faster. Hibernate uses a JBoss DS as database, and I know that JBoss supports ConnectionPooling. Does anyone know what I forgot to enable so that connection pooling is really used, or ...

14. cannot resolve symbol: class Session    forum.hibernate.org

Hello, With Hibernate-2.1 on WinXP & SapDB 7.5, I went through the 'Quickstart with Tomcat', but when I run my 'cat.jsp' I get: cannot resolve symbol symbol : class Session ----- Using NetBeans IDE, I added a 'qstart' project. I added the 'sapdb-7_5_0_5.jar' file to '/common/lib/'. I added 'hibernate2.jar' - and the other required 3rd party libraries - to '/webapps/qstart/WEB-INF/lib/'. I ...

15. Session use after StaleObjectException    forum.hibernate.org

Hi there, was wondering if anyone has a solution to this little problem I have. Basically, I am performing some processing on an object (we'll call it A) as a prelude to an update. As part of the update of this object, I need to update another object (we'll call this one B) to set some information from A. Now these ...

16. 2 HIbernate Sessions doing XA    forum.hibernate.org

Context: Hibernate 2.1.4 + JBoss 3.2.3 + MySQL Goal: to perform XA (distributed transaction) over 2 Hibernate sessions, each session connected to a different data source. Both the datasources are local-tx-datasources since the MySQL Connector/J driver does not support XA. Thus, I am getting a Warning as specified in this wiki item http://www.jboss.org/wiki/Wiki.jsp?page ... MSWithJDBC I want to know of some ...





17. When must Sessions be discarded?    forum.hibernate.org

19. Where can I set session autoClose to false ??    forum.hibernate.org

Hello , I 'm using hibernate 2.1. My problem is that some times the application throws an exception cause by session is closed. After I've debug , I realize that autoClose is set to true..So I think maybe that is the problem. So I wonder where I can set this value to false. Thanks very much Chass

20. Problem wiht HIBERNATE ANd Axis. Cannot get Session...    forum.hibernate.org

Hibernate version: 2.1 Mapping documents: Code between sessionFactory.openSession() and session.close(): public class HibernatePersistenceManager implements PersistenceManager { private LogWrapper _log = new LogWrapper(this.getClass().getName()); /** * the path to the xml configuration file. the path should start with a * '/' character and be relative to the root of the class path. * (DEFAULT: "/hibernate.cfg.xml") */ private String _configFilePath = "/hibernate.cfg.xml"; /** * ...

21. Access session in a custom type    forum.hibernate.org

22. Leaving sessions unclosed in TransactionSynch    forum.hibernate.org

rammic wrote: I don't mean to thread-hijack, but would this have any relation to why I keep receiving [TransactionSynch] Session already closed messages in JBoss 4.0.0? I've never gotten these messages before (with the 3.2.x/hibernate setup) and it doesn't seem to affect the operation, but the fact that the message keeps appearing is a bit concerning. Make sure you neither flush ...

23. Beginning two transctions in one session    forum.hibernate.org

24. Should I call "session.beginTransaction()" when I    forum.hibernate.org

Session session=HibernateUtil.currentSession(); Transaction t=session.beginTransaction(); // <----It is nessecery to ...

25. "No persister found" _only_ from session.get    forum.hibernate.org

26. no setInterceptor-Method in Session - why ?    forum.hibernate.org

Newbie Joined: Sun Sep 21, 2003 3:04 pm Posts: 11 Location: Germany Code: /** * Return a new Session object that must be closed when the work has been completed. * * @param factoryName the config file must match the meta attribute ...

27. General question about session.beginTransaction()    forum.hibernate.org

Session sess = factory.openSession(); Transaction tx; try { tx = sess.beginTransaction(); //do some work ... tx.commit(); } catch (Exception e) { if (tx!=null) tx.rollback(); throw e; } finally { ...

28. Session.contains() always returns false    forum.hibernate.org

X and Y are 2 instances of the same row in the table. Therefor it would make sense to do an equals() comparison in contains(). Otherwise the problem becomes that you have to lock() _all_ detached objects at the beginning of every request (if you're down with the session-per-request-with-detached-objects"-style). The you have to centralize references to all detached object, because if ...

29. Reusing sessions    forum.hibernate.org

30. Dialect used on Session    forum.hibernate.org

32. Getting old and new values when I use session.get()    forum.hibernate.org

This is weird, and is probably due to my inexperience with Hibernate. I'm making changes to my db through Hibernate, and sometimes I still get the old value. In my web app, I use session.get(MyPoJo.class, pojoID) When I invoke getName(), my object sometimes returns the name it had BEFORE I changed the db, and sometimes it returns the new saved name. ...

33. Session finalization issues    forum.hibernate.org

I am using Hibernate version 2.1.7c. I am using the session-per-transaction pattern with a CMT bean. I am load testing the application and have the following code executing in a non-transactional bean. Code: while (!done && tries

34. Problem setting up session    forum.hibernate.org

package net.sf.hibernate.examples.quickstart; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Session; import net.sf.hibernate.Transaction; public class TestHibernate { public static void main(String args[]) throws HibernateException { Session session = HibernateUtil.currentSession(); Transaction tx = session.beginTransaction(); ...

35. Any Api method to iterate over the session    forum.hibernate.org

36. Which Session methods are you using?    forum.hibernate.org

We just completed our very first J2EE app. This app was strictly a "view" only app so we did not have to use much of the Save or Update methods. We currently use CreateQuery and Find mostly. HOWEVER, the more I read "Hibernate in Action", and with future projects coming our way, I see where we will most definitely use more ...

37. hibernate session    forum.hibernate.org

Ok, I know I am just doing something stupid here, but could someone give me a heads up on what that is. I have objects that must be lazily loaded that at some places are 4-5 levels deep. These objects are needed in various places of my application. To prevent my sessions from being closed, I have the following method: /** ...

38. possible nonthreadsafe access to session    forum.hibernate.org

Hi all, I have a problem about transaction management. When user clicks insert, I create a transaction and call session.save, but dont commit it, untill user clicks "commit". If user "commit"s, I do some validation check on the operated object, if it is valid , then I call t.commit else I dont commit it and rollback I changes in RAM level. ...

39. "but I _do_ have a Session..."    forum.hibernate.org

[Hibernate 2.1] The log messages show a session being opened... and then: 17:20:04,368 DEBUG SessionImpl:531 - opened session 17:20:04,370 DEBUG JDBCTransaction:37 - begin 17:20:04,373 DEBUG JDBCTransaction:41 - current autocommit status:false com.wrinkledog.phydeaux.model.Publication@1 17:20:04,380 ERROR LazyInitializationException:25 - Failed to lazily initialize a collection - no session or session was closed net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was ...

40. Session.get(): Issue or undocumented feature ...    forum.hibernate.org

Looking for bug in our program, I spotted something, which is either a bug in Hibernate or simply undocumented Feature. We are using Hibernate 2.1.7, jTDS and SQLServer. First, there was a bug in our program, where a false id was provided to an internal method. This method called the Session.get() with the false id and the result was not what ...

41. 1 Session or 2 Session for 2 task?    forum.hibernate.org

Hibernate version: 2.17 In my code I have to do 2 tasks. The 2nd task I want to do only when the 1st task has been completed successfully. If any exception is thrown in 2nd task (whether I am catching it or not), I still want the 1st task to remain successful. My question is should I use 1 session for ...

42. Problem intializing Hibernate Session    forum.hibernate.org

Newbie Joined: Tue Mar 22, 2005 10:31 pm Posts: 8 I have been working with Hibernate for some time now and have not had a problem like this with trying to establish a session. I am working on a portal enviornment, deploying into exo. Everything was working fine and now something seems to have changed and I cannot seem to pinpoint ...

43. Many sessions with one sessionfactory?    forum.hibernate.org

44. DBUser Sessions from same Config    forum.hibernate.org

Hi, I am using Hibernate 3.0.1 and was wondering if anyone new of a good way to open hibernate sessions as different database users from the same sessionFactory? At the moment I am using a custom configuration class that subclasses org.hibernate.cfg.Configuration in order to provide a method, buildSessionFactory(username, password), to create session factories in order to create sessions for specific users. ...

45. Hibernate--Access to Session    forum.hibernate.org

46. Bussines Delegate --> Session Facade    forum.hibernate.org

Hi, My design is: client --> bussines delegate --> session facade ---> application service --> dao ............................................................................... .........................| ............................................................................... .........................| ............................................................................... .......................pojo I have 2 session facade: PurchaseManagement and InventoryManagement. I have a use case that need access to services provided by both session facade. Which is the best solution? 1- Define a bussines delegate for each session facade and the ...

47. Hibernate Session Factories    forum.hibernate.org

Beginner Joined: Wed Jun 01, 2005 6:51 pm Posts: 27 Location: Philippines Hibernate version:2.1.6 Just when I thought we had it, the wsabi SessionFactory is now reading from a hibernate.cfg.xml and setting a datasource defined in the webapp's context but when it tries to instantiate the Session the Liferay DSConnectionProvider intercepts and fails. How do I configure a webapp to use ...

48. Library" org.hibernate.Session"    forum.hibernate.org

49. Session leakage?    forum.hibernate.org

Session sess = factory.openSession(); Transaction tx = null; try { tx = sess.beginTransaction(); // do some work ... tx.commit(); } catch (RuntimeException e) { if (tx != null) tx.rollback(); logError(); } finally { ...

50. Using Same Hibernate Session    forum.hibernate.org

Hi, I've a webapp and a console application that work together. They share the same Database and hibernate mapping files but using different hibernate sessions. It seems that everything that I do in one session (insert, delete...) is not visible to other session until the server restart. Is there a way I could use same session? Thanks

51. session problem    forum.hibernate.org

at java.lang.Thread.run(Thread.java:534) Class CategoryManager Function: createCategory org.hibernate.HibernateException: Session is closed at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:94) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java :95) at com.transversalnet.hibernate.HibernateUtil.commitTransaction(Hibernat eUtil.java:182) at com.transversalnet.docmanager.category.CategoryManager.create(Categor yManager.java:215) at com.transversalnet.docmanager.category.CategoryUtil.addRootCategory(C ategoryUtil.java:38) at com.transversalnet.servlets.docmanager.CategoryControllerServlet.doGe t(CategoryControllerServlet.java:67) at com.transversalnet.servlets.docmanager.CategoryControllerServlet.doPo st(CategoryControllerServlet.java:154) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard ContextValve.java:198)

52. Problem when adding element to Session    forum.hibernate.org

Hi I have two tables Parent and Child PARENT CHILD --------- -------- Id ChildID Name Name Parent_ID I have a mapping file name person.hbm.xml which has mapping info

53. What exactly is unsafe use of the session    forum.hibernate.org

I'm getting some AssertionFailures (collection not processed by flush) that I can't seem to understand the source of. Before I go trying to produce a test case, could someone enlighten me about: 1) What exactly is unsafe use of the session. 2) What sort of things could cause a collection not processed by flush AssertionFailure. It would help me to try ...

54. session.setReadOnly() and TransientObjectException    forum.hibernate.org

thank you very much, but this makes my lazy collections - which I like quite a lot - not working anymore, especially as I am using the Open Session in View approach with org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor I was trying to find the problem with setReadOnly in the source code, but unfortunatelly I got lost too early...

55. ConcurrentModificationException in Session.getEntityName()    forum.hibernate.org

Newbie Joined: Fri Aug 26, 2005 10:07 am Posts: 2 Hi, under certain circumstances I get a java.util.ConcurrentModificationException from SessionImpl.getEntityName(). It occures only, when I call getEntityName() on an entity that has lazy associations. As you can see in the stacktrace the exception occurs in PersistenceContext.containsProxy(), where the proxy checking and lazy-initializer-fetching happens. The problem seems to be that if the ...

56. Session is not flushed    forum.hibernate.org

With Hibernate, you have to use JDBCTransactionFactory if you decide to use Hibernate in non-managed environment (without app server), else JTA (if u have app server that is capable of managing JTA). Dont know if you can use UserTransaction (or JTA Transaction) provided by API though Hibernate Transaction is a descendant of it.

57. Proper Use of Session?    forum.hibernate.org

Different options - One - Use 1 session per business method that is exposed to the client. So, for example, if the client wants to do saveOrder(), that uses one session. If client wants to invoke updateUser(), that uses different session. This assumes that there is a clear separation between where the client ends and server starts. This is closer to ...

58. session terminated unexpectedly    forum.hibernate.org

This is a strange problem, session is closed unexpectedly. And even worse, I can not reproduce the problem. I am using Websphere 5.0.2, UDB 8.1 and Hibernate 2.0. The process is try to convert a few XML to PDF via FOP and update database with these documents attributes (like, subject, release date etc...). In the code, I opened one session, and ...

59. Listener to detect when a session becomes dirty    forum.hibernate.org

Hi! Is there an easy way to detect when a session becomes dirty? I need a listener or something that notifies me as soon as the state of an object under hibernate's control has been changed. My application has a "save-button" which is normally disabled. It should become enabled automatically when the users changes the value of an object. I tried ...

60. Hibernate Session problem    forum.hibernate.org

Hi, We are using a Hibernate in our application the scenario like this we have two methods one for writing and another for reading data from DB we am runing thsese two methods in sequence ( I mean one after the another) The first method is executing without any errors, while second method execution, the following error is throwing. We are ...

61. If Session.reconnect() does nothing, now what???    forum.hibernate.org

Hmm... that doesn't really help. I'm using the session-per-request pattern for all of my app except one place where I'd like to use a long transaction. All I want to know is how to reconnect a session, not use an entirely new session handling routine that's not going to work for my use case.

62. onPostDelete and temporary sessions    forum.hibernate.org

Hibernate version:3.1 I'm trying to figure out how to use the event handlers in Hibernate. Here is what I'm trying to accomplish: I have a Parent object and a Child object. I have a post-delete event handler for the Child object. When a Child is deleted I want to check if there are any other siblings under the Parent. If not, ...

63. tracking down an unclosed session    forum.hibernate.org

Hi, I'm running hibernate in a tomcat container and there seems to be a background thread that is printing a message to console saying... WARNorg.hibernate.jdbc.ConnectionManager [WARN ] - unclosed connection, forgot t o call close() on your session? I make a lot of calls to hibernate and am wondering if there is a way where I can get some more info ...

64. Which method of Session should I choose?    forum.hibernate.org

Hi, I have an object deserialized from XML ( through XStream ), which method of Session should I use to save the object to DB? Before I save it, neither do I know if there is an instance of this object associated with the session, nor if there is a record with the same id in db. What can I do ...

65. About Hibernate Session    forum.hibernate.org

Hi, I'm a newbie in Hibernate.I'm hoping someone would answer.. In our application we are using Spring services and Hibernate as ORM.Now, the Spring injects a session factory to the DAO everything is great so faar.. The question is :- In my DAO if I access Hibernate Session as Session session = SessionFactoryUtils.getSession(getSessionFactory(), false); does this session be in the Transaction ...

66. Simple (novice) question about sessions    forum.hibernate.org

67. private Session session = HibernateSessionFactory.currentSes    forum.hibernate.org

Hai, I have a great problem.I have a class: public class Fifa { private Session session = HibernateSessionFactory.currentSession(); .... ... } In my Java Server Page I create a new object of Fifa: <% Fifa fifa = new Fifa(); %> Login

JSF-Beispielanwendung zur Berechnung eines Flcheninhaltes:

Dieses Programm berechnet aufgrund der Eingabe einer Seitenlnge den Flcheninhalt ...

68. proper session managment    forum.hibernate.org

Hi, I'm using Hibernate in a web application framework and have a thread local object that has a method used by a lot of different classes during the request cycle to get a hibernate session. In regards to this I'm stuck on something very simple. When a class requests a session does the thread local object call sessionfactory.createSession() for each getSession() ...

69. Session.setReadOnly throws TransientObjectException    forum.hibernate.org

if(readOnly) { Class clazz = persistable.getClass(); if(clazz.getName().contains("EnhancerByCGLIB")) { clazz = clazz.getSuperclass(); ...

70. One app; 2 DBs, 2 Sessions??    forum.hibernate.org

I'm using Hibernate 3.1 to develop some utilities to work with our Oracle 9 db. We run two databases, a parallel and production version. Most all of my queries are links on a webpage to a report or lookup. The user has the choice between the parallel or production version. I have tried creating two configuration files, instantiating both, and setting ...

71. hibernate Tapestry session    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: Name and version of the database you are using: The generated SQL (show_sql=true): Debug level Hibernate log excerpt: i'm a newbie in tapestry and i have a problem that i dont find any solutions. ...

72. IllegalStateException: Inactive logical session handle call    forum.hibernate.org

Hi, Hibernate ver. 2.1.6 Oracle 9.2.0.1.0 Weblogic 8.1 SP3 During load-tests of application following exception sometimes occures: Code: Caused by: java.lang.IllegalStateException: Inactive logical session handle called at net.sf.hibernate.jca.ManagedConnectionImpl.getSession(ManagedConnectionImpl.java:357) ... Have anybody an idea what can cause this? I first thought, that may be it's connected with lack of connections in servers's JDBC pool but monitoring page of ...

73. Execute native with DML through Hibernate Session    forum.hibernate.org

Hello, I am using Hibernate 3.1 in Jboss 4.0.3. I have to execute a lot of native update queries from within a stateless BMT Session bean. I am following the suggestions in this thread, but have the impression that the queries are not executed within the current transaction scope. Here's my code for executing native SQL. The session has been passed ...

74. supernatural session stickyness?    forum.hibernate.org

It looks like your XML serialization is pretty accurate :) so it delivered H collection proxy across that keeps association to the old session, invalid by now of course. You may need to go through your object and replace H implementations of collection interfaces with standard java ones before sending. For example: o.setList( new ArrayList( o.getList() ) );

75. Session demarcation in nested functions    forum.hibernate.org

Hi. I've got method Code: public User getUser(Integer id){ Session session=null; try{ session=HibUtil.getSessionFactory().openSession(); return (User) session.get(User.class, id); ...

76. Quesion about get() method in Session class    forum.hibernate.org

77. session.getConnection().setCatalog()    forum.hibernate.org

78. anybody can exlpain session?    forum.hibernate.org

Hello, you can disconnect a session from the underlying jdbc connection, which is useful for long session handling. Read about this in the Hibernate reference. In my book is not yet a complete example project for this kind of usage. I suppose that the session is still open in this moment but I did not use this approach, so you may ...

79. Guarantee SessionFactory doesn't re-use Sessions    forum.hibernate.org

Hibernate version: 3 Name and version of the database you are using: Oracle 10g-RAC I'm using one-user, one-connection to the Oracle DB, and went down the path of starting a single (Long) Hibernate Session (and DB connection) at login and retain it throughout the user's use of the application. (Struts/JSP web-app) Works fine with a single user, but during system testing ...

81. How can I remove remove item from session?    forum.hibernate.org

Hello all, I haven't been able to find the answer to this question anywhere and am hoping you can help. Let's say my application selects a bunch of objects from the database as part of a session. Now, let's say I iterate over the items in that collection and try to update each one. But there's other applications running that are ...

82. any way one can implement custom sessionfactory and session    forum.hibernate.org

To invoke the custom sessionfactoryImpl class I tried to give a property in the hibernate configuration XML file. Hibernate did not invoke my implementation at all. I agree that, it is not advised to do so. However, I am in a situation wherein, I believe this will probably be a solution to the dilema at hand.

83. operations with two session factories    forum.hibernate.org

Hi, I'm using JBoss, Hibernate and MySql and I have the following problem: My project has a bean, in a SessionFactory, that needs to remove some POJOs and than needs to run a method in another bean, in another SessionFactory. This second bean removes one POJO, that is present in the POJOs removed by the first bean, because it apears in ...

84. session probs, URGENT    forum.hibernate.org

...

86. LocalThread session problem...    forum.hibernate.org

Hibernate version:3.1 Hello everybody... I've started using hibernate in a web application that I'm developing, and I'm pretty worried about one thing: I read in Hibernate in Action that it's recommended to instantiate a session and put it in a LocalThread in the HibernateUtil object, so when an object makes a request to HibernateUtil asking for a session, HibernateUtil verify if ...

87. To get a Session of an existing SessionFactory    forum.hibernate.org

Try this, public class HibernateHelper{ protected static SessionFactory hibernateFac = null; protected Session session; protected void closeHibernateSession(Session session) throws Exception { if (session != null) { try { session.close(); } catch (HibernateException e) { e.printStackTrace(); } } } public void closeSession()throws Exception { this.closeHibernateSession(session); } public static SessionFactory getHibernateFactory() throws Exception { SessionFactory sessionFactory = null; try { sessionFactory= new Configuration().configure().buildSessionFactory(); ...

88. Hibernate Session    forum.hibernate.org

I would like to get some clarifications between Session.lock and Session.refresh. For instance I open a session, load my object(X) and then close the session. When I try to access the collection(Y) of object(X), I get owing session was closed . do , I need to open a new session and reassociate the parent object with session.lock(X, LockMode.NONE) Could some one ...

89. Weird:Session Creation Fails after Redeployment (not before)    forum.hibernate.org

Author Message cagara Post subject: Weird:Session Creation Fails after Redeployment (not before) Posted: Tue Jun 27, 2006 5:06 pm Newbie Joined: Fri Nov 04, 2005 5:40 pm Posts: 16 The Problem: When i start my JBoss Server everything works great on the first deployment. But when i redeploy the Application without rebooting the Server the Hibernatesessionfactory seems having weird ...

90. different behaviour in new session    forum.hibernate.org

hi, I'm getting very strange behaviour (using 3.1.3, but even with the most current version: 3.2.0.cr2) and I hope there's something obvious I've missed summary: * adding/removing mappings for POJOs that are never even used makes Hibernate throw an exception * executing the exact same finder (after just having created some entities) in a different session makes Hibernate throw an exception ...

91. Hibernate session issue    forum.hibernate.org

I face a problem while using Hibernate. I do a search on owner names and get a list of owner id and names and when I click on a particular owner it takes me to the view screen. To view the details of owner, the method(code piece) which I use is - session = HibernateSessionFactory.getInstance().currentSession(); tx = session.beginTransaction(); TFmsOwnerInformation tOwner = ...

92. Reinit Expired Hibernate Session    forum.hibernate.org

93. Session disconecting problem    forum.hibernate.org

94. Session problem    forum.hibernate.org

hi, Iam new to Hibernate and I have a small application which has ADD and LIST functionality. Following are the environment: Tapestry 4.0 [ for web development] Hibernate 3 [ for mapping java classes to the oracle database] Jdk 1.4 And Eclipse 3.1 [IDE] My application is working fine but there is one single problem: When I Add details for the ...

95. Session disconecting    forum.hibernate.org

96. Question about session disconnecting    forum.hibernate.org

97. Question about session implementation    forum.hibernate.org

Hi, I'm building a desktop application (SWT/JFACE) and I'm a little bit confused about the way I work with sessions. I started using the singleton class from Hibernate reference documentation. Then I realized that I will need something more complex. I tried different things and I realized that I'll probably need help... The main problem for me is the Unit of ...

98. which one between these two coding style(using session)?    forum.hibernate.org

Sorry for my poor english^^; multithreaded evnvironment. about 15 java application using hibernate session. all java files have code like this. Code: session sess = null; Transaction tx = null; //some hibernate concern code 1 try{ sess = HibernateUtil.openSession(); tx = sess.beginTransaction(); .... } catch(HibernateException e){ ...

99. Question about session behaviour    forum.hibernate.org

I have a JSF web app with Hibernate 3.1. The session-per-request pattern is set up by having "current_session_context_class" set to "thread" in hibernate.cfg.xml. The database connections are obtained from a connection pool configured in the application server (Sun Application Server PE 8.2). I can do r/w operations obtaining the session from HibernateUtil.getCurrentSession(). However, if after commit I do a Hibernate.getCurrentSession(), the ...

100. Session.contains doesn't work    forum.hibernate.org