Announcement Announcement Module
Collapse
No announcement yet.
Error when updting hibernate object using Spring Session Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error when updting hibernate object using Spring Session

    Hello all,
    i wrote a Quartz Job which uses Informa's FeedParser for downloading RSS data & store it into a database.
    Basically i have a list of channels, each containing a 'bag' of items. the code looks for new items from the channel, updates the items table and update consequently also the channels table.
    Code was using Hibernate Session , and since my application is using Spring i decided to use Spring's Hibernate Session.
    But in doing that, i had an exception while updating channels. I suspect that, since it is updating the 'items' children of the channel, when i call session.update it will update also the channel.
    Weird thing is that if i use straight Hibernate session, code works just fine..
    Can anyone tell me what is the problem?

    Below is the code which is raising exception. There are lines commented out regarding getting Hibernate session from SessionHandler. If i use those lines, code works just fine.

    This is the code:
    Code:
    SchedulerContext schedulerContext = context.getScheduler().getContext(); 
    		BeanFactory beanFactory = (BeanFactory)schedulerContext.get("applicationContext"); 
    		
    		net.sf.hibernate.SessionFactory factory = (net.sf.hibernate.SessionFactory)beanFactory.getBean("stockSessionFactory");
    		System.err.println("getting session from factory...");
    		session = SessionFactoryUtils.getNewSession(factory);
    		//session = SessionHandler.getInstance().getSession();
    
               	Query query = session.createQuery("from Channel c where c.id = " + channelId);
               	List channels = query.list();
    	
    
    		tx = session.beginTransaction();		
    		if ((channels != null) && !channels.isEmpty()) {
    			channel = (de.nava.informa.impl.hibernate.Channel) channels.get(0);
    		}
    		ChannelBuilderIF builder = new ChannelBuilder(session);
    		System.err.println("*************************** Channel location=" + channel.getLocation());
    		ChannelIF tempChannel = FeedParser.parse(builder,
    							 channel.getLocationString());
    
    		System.err.println("copying channel...");
    		InformaUtils.copyChannelProperties(tempChannel, channel);
    		channel.setLastUpdated(new Date());
               	Collection items = channel.getItems();
    		System.err.println("Got exactly:" + items.size() + " channels..");
    				
    		Iterator itemIter = items.iterator();
    		ItemIF  oldItem = null;
    
    		Collection newItems = new ArrayList();
    		while(itemIter.hasNext()) {
    			oldItem = (ItemIF)itemIter.next();
    			//System.out.println(oldItem.getTitle() + " : " +
    			//		   oldItem.getLink());
    		}
    		// compare with existing items, only add new ones
    		if (tempChannel.getItems().isEmpty()) {
    			System.out.println("No items found in channel " +
    	       			  	   channel.getLocation());
                   
    		} else {
    			Iterator it = tempChannel.getItems().iterator();
    			while (it.hasNext()) {
    				ItemIF item = (ItemIF) it.next();
    			        //System.out.println(channel.getItems().contains(item) +
    				//		    " : " + item);
    		                if (!channel.getItems().contains(item)) {
    					//System.out.println("Found new item: " + item);
    					newItems.add(item);
    				}
    			} // while more items
                    }
    
    		Iterator newIter = newItems.iterator();
    		ItemIF item = null;
    		while(newIter.hasNext()) {
    			item = (ItemIF) newIter.next();
    			channel.addItem(builder.createItem(channel, item));
    		}
    		System.out.println("Done copying...");
    		session.delete(tempChannel);
           } catch (HibernateException hex) {
               System.err.println(hex.getMessage()+ hex);
               throw new JobExecutionException(hex);
           } catch (IOException ioe) {
               System.err.println(ioe.getMessage()+ ioe);
               throw new JobExecutionException(ioe);
           } catch (ParseException pe) {
               System.err.println(pe.getMessage() + pe);
               throw new JobExecutionException(pe);
           } catch (SchedulerException hex) {
               System.err.println(hex.getMessage()+ hex);
               throw new JobExecutionException(hex);
           }/* catch (PersistenceException ioe) {
               System.err.println(ioe.getMessage()+ ioe);
               throw new JobExecutionException(ioe);
           
           }*/ finally {
               try {
                   session.update(channel);
                   tx.commit();
                   session.close();
               } catch (HibernateException hex) {
                   System.err.println(hex.getMessage()+ hex);
                   throw new JobExecutionException(hex);
               }
           }
    THis is the exception
    Code:
    2005-06-06 17:34:05,500 DEBUG [net.sf.hibernate.impl.SessionImpl] Collection dirty: [de.nava.informa.impl.hibernate.Channel.items#2]
    2005-06-06 17:34:05,500 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushing entities and processing referenced collections
    2005-06-06 17:34:05,515 INFO  [STDOUT] identifier of an instance of de.nava.informa.impl.hibernate.Channel altered from 2 to 2net.sf.hibernate.HibernateException: identifier of an instance of de.nava.informa.impl.hibernate.Channel altered from 2 to 2
    2005-06-06 17:34:05,515 INFO  [org.quartz.core.JobRunShell] Job DEFAULT.reutersJob threw a JobExecutionException: 
    org.quartz.JobExecutionException: net.sf.hibernate.HibernateException: identifier of an instance of de.nava.informa.impl.hibernate.Channel altered from 2 to 2 [See nested exception: net.sf.hibernate.HibernateException: identifier of an instance of de.nava.informa.impl.hibernate.Channel altered from 2 to 2]
    	at com.myapp.scheduler.InformaJob.executeInternal(InformaJob.java:155)
    	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:66)
    	at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
    	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
    * Nested Exception (Underlying Cause) ---------------
    net.sf.hibernate.HibernateException: identifier of an instance of de.nava.informa.impl.hibernate.Channel altered from 2 to 2
    	at net.sf.hibernate.impl.SessionImpl.checkId(SessionImpl.java:2522)
    	at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2345)
    	at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2338)
    	at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2205)
    	at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2184)
    	at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
    	at com.myapp.scheduler.InformaJob.executeInternal(InformaJob.java:151)
    	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:66)
    	at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
    	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
    and this is the Channels.hbm.xml

    Code:
    <?xml version="1.0"?>
    
    <!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
        "http&#58;//hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
    
    <hibernate-mapping>
        <class
            name="de.nava.informa.impl.hibernate.Channel"
            table="CHANNELS"
            dynamic-update="false"
            dynamic-insert="false"
        >
    
            <id
                name="id"
                column="CHANNEL_ID"
                type="integer"
                unsaved-value="-1"
            >
                <generator class="native">
                </generator>
            </id>
    
            <property
                name="title"
                type="java.lang.String"
                update="true"
                insert="true"
                column="TITLE"
                not-null="true"
            />
    
            <property
                name="description"
                type="java.lang.String"
                update="true"
                insert="true"
                column="DESCRIPTION"
            />
    
            <property
                name="locationString"
                type="string"
                update="true"
                insert="true"
                column="LOCSTRING"
            />
    
    
            <property
                name="creator"
                type="java.lang.String"
                update="true"
                insert="true"
                column="CREATOR"
            />
    
            <property
                name="publisher"
                type="java.lang.String"
                update="true"
                insert="true"
                column="PUBLISHER"
            />
    
            <property
                name="language"
                type="java.lang.String"
                update="true"
                insert="true"
                column="LANGUAGE"
            />
    
            <property
                name="formatString"
                type="string"
                update="true"
                insert="true"
                column="FORMAT"
            />
    
                <bag
                name="items"
                table="ITEMS"
                lazy="false"
                inverse="true"
                cascade="all"
            >
    
                  <key
                      column="CHANNEL_ID"
                  />
    
                  <one-to-many
                      class="de.nava.informa.impl.hibernate.Item"
                  />
            </bag>
    
            <many-to-one
                name="image"
                class="de.nava.informa.impl.hibernate.Image"
                cascade="none"
                outer-join="auto"
                update="true"
                insert="true"
                column="IMAGE_ID"
                not-null="false"
            />
    
            <many-to-one
                name="textInput"
                class="de.nava.informa.impl.hibernate.TextInput"
                cascade="none"
                outer-join="auto"
                update="true"
                insert="true"
                column="TEXTINPUT_ID"
                not-null="false"
            />
    
            <property
                name="copyright"
                type="java.lang.String"
                update="true"
                insert="true"
                column="COPYRIGHT"
            />
    
            <property
                name="rating"
                type="java.lang.String"
                update="true"
                insert="true"
                column="RATING"
            />
    
           
    
            <property
                name="generator"
                type="java.lang.String"
                update="true"
                insert="true"
                column="GENERATOR"
            />
    
            <property
                name="docs"
                type="java.lang.String"
                update="true"
                insert="true"
                column="DOCS"
            />
    
            <property
                name="ttl"
                type="int"
                update="true"
                insert="true"
                column="TTL"
            />
    
            
    
            <property
                name="lastUpdated"
                type="java.util.Date"
                update="true"
                insert="true"
                column="LAST_UPDATED"
            />
    
            <property
                name="lastBuildDate"
                type="java.util.Date"
                update="true"
                insert="true"
                column="LAST_BUILD_DATE"
            />
    
            <property
                name="pubDate"
                type="java.util.Date"
                update="true"
                insert="true"
                column="PUB_DATE"
            />
    
            <property
                name="updatePeriod"
                type="java.lang.String"
                update="true"
                insert="true"
                column="UPDATE_PERIOD"
            />
    
            <property
                name="updateFrequency"
                type="int"
                update="true"
                insert="true"
                column="UPDATE_FREQUENCY"
            />
    
            <property
                name="updateBase"
                type="java.util.Date"
                update="true"
                insert="true"
                column="UPDATE_BASE"
            />
    
    	
        </class>
    
        <query name="ChannelQuery"><!&#91;CDATA&#91;
                from de.nava.informa.impl.hibernate.Channel c WHERE c.id like ?   
            &#93;&#93;>
        </query>
    
    
    
    </hibernate-mapping>
    I can mail privately the server.log that shows the stacktrace from hibernate if needed..

    thanx in advance and regards
    marco

  • #2
    Reposted http://forum.springframework.org/showthread.php?t=15503.
    Last edited by robyn; May 16th, 2006, 04:12 AM.

    Comment


    • #3
      What exactly does SessionHandler does? I think the problem occurs (as I also responded before I think) that you are tempering with the id on an object that is connected to the session.
      One very subtle thing that might happen would be that Spring gives your through the SessionFactoryUtil a session proxy that doesn't close by your calls but rather by the TransactionManager.
      Check the logs and sees how it reacts to your close() and transaction actions.

      Comment


      • #4
        Hello,
        i tried to debug a littl bit more my code...
        i decided to remove the final session.update to see what was happening, and i found out that the error does NOT happen during session.update, but rather when calling tx.commit()..
        at the moment i am using spring 1.2.1, and i modified my code as below..
        Code:
        Transaction tx = null;
        	de.nava.informa.impl.hibernate.Channel channel = null;
        	net.sf.hibernate.Session session = null;
        	net.sf.hibernate.SessionFactory factory = null;
        	try &#123;
        		//String query = "ChannelQuery";
        		Object&#91;&#93; params = new Object&#91;&#93;&#123;channelId&#125;;
        		SchedulerContext schedulerContext = context.getScheduler&#40;&#41;.getContext&#40;&#41;; 
        		BeanFactory beanFactory = &#40;BeanFactory&#41;schedulerContext.get&#40;"applicationContext"&#41;; 
        		
        		factory = &#40;net.sf.hibernate.SessionFactory&#41;beanFactory.getBean&#40;"stockSessionFactory"&#41;;
        		System.err.println&#40;"getting session from factory..."&#41;;
        		session = SessionFactoryUtils.getNewSession&#40;factory&#41;;
        		
        
        		//session = SessionHandler.getInstance&#40;&#41;.getSession&#40;&#41;;
        
        
        		tx = session.beginTransaction&#40;&#41;;		
        
        		if&#40;tx == null&#41;
        			System.err.println&#40;"Ohi!! Transaction is nul lwhen calling beginTransaction!!"&#41;;
        		else
        			System.err.println&#40;"Transactionis fine!!!"&#41;;
        
        		Query query = session.createQuery&#40;"from Channel c where c.id = " + channelId&#41;;
                   	List channels = query.list&#40;&#41;;
        	
        
        		if &#40;&#40;channels != null&#41; && !channels.isEmpty&#40;&#41;&#41; &#123;
        			channel = &#40;de.nava.informa.impl.hibernate.Channel&#41; channels.get&#40;0&#41;;
        		&#125;
        		
        		ChannelBuilderIF builder = new de.informa.nava.impl.hibernate.ChannelBuilder&#40;session&#41;;
        		System.err.println&#40;"*************************** Channel location=" + channel.getLocation&#40;&#41;&#41;;
        		ChannelIF tempChannel = FeedParser.parse&#40;builder,
        							 channel.getLocationString&#40;&#41;&#41;;
        
        		System.err.println&#40;"copying channel..."&#41;;
        		InformaUtils.copyChannelProperties&#40;tempChannel, channel&#41;;
        		channel.setLastUpdated&#40;new Date&#40;&#41;&#41;;
                   	Collection items = channel.getItems&#40;&#41;;
        		System.err.println&#40;"Got exactly&#58;" + items.size&#40;&#41; + " channels.."&#41;;
        				
        		Iterator itemIter = items.iterator&#40;&#41;;
        		ItemIF  oldItem = null;
        
        		Collection newItems = new ArrayList&#40;&#41;;
        		while&#40;itemIter.hasNext&#40;&#41;&#41; &#123;
        			oldItem = &#40;ItemIF&#41;itemIter.next&#40;&#41;;
        			//System.out.println&#40;oldItem.getTitle&#40;&#41; + " &#58; " +
        			//		   oldItem.getLink&#40;&#41;&#41;;
        		&#125;
        		// compare with existing items, only add new ones
        		if &#40;tempChannel.getItems&#40;&#41;.isEmpty&#40;&#41;&#41; &#123;
        			System.out.println&#40;"No items found in channel " +
        	       			  	   channel.getLocation&#40;&#41;&#41;;
                       
        		&#125; else &#123;
        			Iterator it = tempChannel.getItems&#40;&#41;.iterator&#40;&#41;;
        			while &#40;it.hasNext&#40;&#41;&#41; &#123;
        				ItemIF item = &#40;ItemIF&#41; it.next&#40;&#41;;
        			        //System.out.println&#40;channel.getItems&#40;&#41;.contains&#40;item&#41; +
        				//		    " &#58; " + item&#41;;
        		                if &#40;!channel.getItems&#40;&#41;.contains&#40;item&#41;&#41; &#123;
        					//System.out.println&#40;"Found new item&#58; " + item&#41;;
        					newItems.add&#40;item&#41;;
        				&#125;
        			&#125; // while more items
                        &#125;
        
        		Iterator newIter = newItems.iterator&#40;&#41;;
        		ItemIF item = null;
        		while&#40;newIter.hasNext&#40;&#41;&#41; &#123;
        			item = &#40;ItemIF&#41; newIter.next&#40;&#41;;
        			System.err.println&#40;"Adding item&#58;" + item.getTitle&#40;&#41;&#41;;
        			channel.addItem&#40;builder.createItem&#40;channel, item&#41;&#41;;
        		&#125;
        		System.out.println&#40;"Done copying..."&#41;;
        		session.delete&#40;tempChannel&#41;;
               &#125; catch &#40;HibernateException hex&#41; &#123;
                   System.err.println&#40;hex.getMessage&#40;&#41;+ hex&#41;;
                   throw new JobExecutionException&#40;hex&#41;;
               &#125; catch &#40;IOException ioe&#41; &#123;
                   System.err.println&#40;ioe.getMessage&#40;&#41;+ ioe&#41;;
                   throw new JobExecutionException&#40;ioe&#41;;
               &#125; catch &#40;ParseException pe&#41; &#123;
                   System.err.println&#40;pe.getMessage&#40;&#41; + pe&#41;;
                   throw new JobExecutionException&#40;pe&#41;;
               &#125; catch &#40;SchedulerException hex&#41; &#123;
                   System.err.println&#40;hex.getMessage&#40;&#41;+ hex&#41;;
                   throw new JobExecutionException&#40;hex&#41;;
               &#125;/* catch &#40;PersistenceException ioe&#41; &#123;
                   System.err.println&#40;ioe.getMessage&#40;&#41;+ ioe&#41;;
                   throw new JobExecutionException&#40;ioe&#41;;
               
               &#125;*/ finally &#123;
                   try &#123;
        	       System.err.println&#40;"UPDATING NOW..."&#41;;
                       session.update&#40;channel&#41;;
        	       System.err.println&#40;"OK EVERYTHING HAS BEEN UPDATED.."&#41;;
                       tx.commit&#40;&#41;;
        	       System.err.println&#40;"After committing..."&#41;;	
                       SessionFactoryUtils.releaseSession&#40;session,
                                          		  factory&#41;;
                   &#125; catch &#40;HibernateException hex&#41; &#123;
        	       try &#123;
        		tx.rollback&#40;&#41;;
        	       &#125; catch&#40;Exception e&#41; &#123;
        		System.err.println&#40;"Cannt rollback.."&#41;;
        		e.printStackTrace&#40;&#41;;
        		&#125;
                       System.err.println&#40;hex.getMessage&#40;&#41;+ hex&#41;;
                       throw new JobExecutionException&#40;hex&#41;;
                   &#125;
               &#125;
        
               System.out.println&#40;"Done updating channel, " +
        	   		   channel.getLocation&#40;&#41;&#41;;
               
        
        
        	
            &#125;
        In fact, in output i can see 'OK EVERYTHING HAS BEEN UPDATED..";...

        is Spring doing something wrong with Session returned by SessionFactoryUtils?

        Here is what log display, though i doubt it can be useful..
        Code:
        21&#58;24&#58;50,375 INFO  &#91;STDOUT&#93; Hibernate&#58; select channel0_.CHANNEL_ID as CHANNEL_ID
        , channel0_.TITLE as TITLE, channel0_.DESCRIPTION as DESCRIPT3_, channel0_.LOCST
        RING as LOCSTRING, channel0_.CREATOR as CREATOR, channel0_.PUBLISHER as PUBLISHE
        R, channel0_.LANGUAGE as LANGUAGE, channel0_.FORMAT as FORMAT, channel0_.IMAGE_I
        D as IMAGE_ID, channel0_.TEXTINPUT_ID as TEXTINP10_, channel0_.COPYRIGHT as COPY
        RIGHT, channel0_.RATING as RATING, channel0_.GENERATOR as GENERATOR, channel0_.D
        OCS as DOCS, channel0_.TTL as TTL, channel0_.LAST_UPDATED as LAST_UP16_, channel
        0_.LAST_BUILD_DATE as LAST_BU17_, channel0_.PUB_DATE as PUB_DATE, channel0_.UPDA
        TE_PERIOD as UPDATE_19_, channel0_.UPDATE_FREQUENCY as UPDATE_20_, channel0_.UPD
        ATE_BASE as UPDATE_21_ from CHANNELS channel0_ where &#40;channel0_.CHANNEL_ID=1 &#41;
        21&#58;24&#58;50,375 INFO  &#91;STDOUT&#93; Hibernate&#58; select items0_.item_id as item_id__, item
        s0_.CHANNEL_ID as CHANNEL_ID__, items0_.item_id as item_id0_, items0_.title as t
        itle0_, items0_.description as descript3_0_, items0_.link as link0_, items0_.dat
        e as date0_ from items items0_ where items0_.CHANNEL_ID=?
        21&#58;24&#58;53,406 WARN  &#91;SessionImpl&#93; unclosed connection
        21&#58;24&#58;58,640 INFO  &#91;ChannelBuilder&#93; New Channel Builder for&#58; net.sf.hibernate.im
        pl.SessionImpl@184e5a8
        21&#58;24&#58;58,640 INFO  &#91;STDOUT&#93; *************************** Channel location=http&#58;//
        www.microsite.reuters.com/rss/businessNews
        21&#58;24&#58;59,062 INFO  &#91;FeedParser&#93; Channel uses RSS root element &#40;Version 2.0&#41;.
        21&#58;24&#58;59,062 INFO  &#91;STDOUT&#93; Hibernate&#58; insert into CHANNELS &#40;TITLE, DESCRIPTION,
         LOCSTRING, CREATOR, PUBLISHER, LANGUAGE, FORMAT, IMAGE_ID, TEXTINPUT_ID, COPYRI
        GHT, RATING, GENERATOR, DOCS, TTL, LAST_UPDATED, LAST_BUILD_DATE, PUB_DATE, UPDA
        TE_PERIOD, UPDATE_FREQUENCY, UPDATE_BASE&#41; values &#40;?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?&#41;
        21&#58;24&#58;59,062 INFO  &#91;STDOUT&#93; Hibernate&#58; SELECT LAST_INSERT_ID&#40;&#41;
        21&#58;24&#58;59,078 INFO  &#91;STDOUT&#93; copying channel...
        21&#58;24&#58;59,078 INFO  &#91;STDOUT&#93; Got exactly&#58;5278 channels..
        21&#58;24&#58;59,828 INFO  &#91;STDOUT&#93; Done copying...
        21&#58;24&#58;59,828 INFO  &#91;STDOUT&#93; UPDATING NOW...
        21&#58;24&#58;59,828 INFO  &#91;STDOUT&#93; OK EVERYTHING HAS BEEN UPDATED..
        21&#58;25&#58;00,031 INFO  &#91;STDOUT&#93; identifier of an instance of de.nava.informa.impl.hi
        bernate.Channel altered from 1 to 1net.sf.hibernate.HibernateException&#58; identifi
        er of an instance of de.nava.informa.impl.hibernate.Channel altered from 1 to 1
        21&#58;25&#58;00,031 INFO  &#91;JobRunShell&#93; Job DEFAULT.reutersJob threw a JobExecutionExce
        ption&#58;
        org.quartz.JobExecutionException&#58; net.sf.hibernate.HibernateException&#58; identifie
        r of an instance of de.nava.informa.impl.hibernate.Channel altered from 1 to 1 &#91;
        See nested exception&#58; net.sf.hibernate.HibernateException&#58; identifier of an inst
        ance of de.nava.informa.impl.hibernate.Channel altered from 1 to 1&#93;
                at com.myapp.scheduler.InformaJob.executeInternal&#40;InformaJob.java&#58;177&#41;
                at org.springframework.scheduling.quartz.QuartzJobBean.execute&#40;QuartzJob
        Bean.java&#58;66&#41;
                at org.quartz.core.JobRunShell.run&#40;JobRunShell.java&#58;191&#41;
                at org.quartz.simpl.SimpleThreadPool$WorkerThread.run&#40;SimpleThreadPool.j
        ava&#58;516&#41;
        * Nested Exception &#40;Underlying Cause&#41; ---------------
        net.sf.hibernate.HibernateException&#58; identifier of an instance of de.nava.inform
        a.impl.hibernate.Channel altered from 1 to 1
                at net.sf.hibernate.impl.SessionImpl.checkId&#40;SessionImpl.java&#58;2522&#41;
                at net.sf.hibernate.impl.SessionImpl.flushEntity&#40;SessionImpl.java&#58;2345&#41;
                at net.sf.hibernate.impl.SessionImpl.flushEntities&#40;SessionImpl.java&#58;2338
        &#41;
                at net.sf.hibernate.impl.SessionImpl.flushEverything&#40;SessionImpl.java&#58;22
        05&#41;
                at net.sf.hibernate.impl.SessionImpl.flush&#40;SessionImpl.java&#58;2184&#41;
                at net.sf.hibernate.transaction.JDBCTransaction.commit&#40;JDBCTransaction.j
        ava&#58;61&#41;
                at com.myapp.scheduler.InformaJob.executeInternal&#40;InformaJob.java&#58;165&#41;
                at org.springframework.scheduling.quartz.QuartzJobBean.execute&#40;QuartzJob
        Bean.java&#58;66&#41;
                at org.quartz.core.JobRunShell.run&#40;JobRunShell.java&#58;191&#41;
                at org.quartz.simpl.SimpleThreadPool$WorkerThread.run&#40;SimpleThreadPool.j
        ava&#58;516&#41;
        anyone can help out pls? it has been 4 days that i am stuck on this :-(

        thanx in advance and regards
        marco

        Comment


        • #5
          marco, look into the Spring code and try to figure out what's happening there. I know it's not very helpful but this way you'll find out what are the differences between the session returned by Spring and by the one returned by your helper class.

          Comment


          • #6
            Hello,
            i had a look at SourceCode.... didnt' find much (or mayb i didn't look deep enough)..
            however i found on the net at this link
            http://www.guj.com.br/posts/list/9735.java
            that the problem may be due to the fact that my Channels object may have been loaded more than 1 time, and thus is still in Hibernate cache..
            i grabbed the source code of my RSS parser, and i found out that actually i am loading Channels object twice...
            i have to look again, but what i am suspecting is that in my code i am using Session from Spring, while in the RSS parser code, some part of the code is still using Hibernate session from Hibernate's SessionHandler...
            i'll post again if i have any updates on the matter

            thanx and regards
            marco

            Comment

            Working...
            X