You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Murray Collingwood <mu...@focus-computing.com.au> on 2005/10/03 05:30:29 UTC

[Hibernate] Who owns the problem?

Hi guys

I'm getting exceptions with some Hibernate code and when I post on the Hibernate 
forum they are claiming it is a Struts issue.  I've read lots of stuff from almost 
everywhere and continue to struggle with this implementation.

Please check out the background (and config/code) at: 
http://forum.hibernate.org/viewtopic.php?p=2264278

Please let me know if this is a Struts problem or a Hibernate problem.  Maybe there's a 
simple solution I'm missing?

Kind regards
mc


FOCUS Computing
Mob: 0415 24 26 24
murray@focus-computing.com.au
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [Hibernate] Who owns the problem?

Posted by Murray Collingwood <mu...@focus-computing.com.au>.
Thanks David

I made the change as you suggested but this reported an error, you can only specify 
servlet-name or url-pattern.  I removed the url-pattern and set the servlet-name 
appropriately.

It now seems to be working much better.  Thanks again.

Kind regards
mc

On 3 Oct 2005 at 0:11, David G. Friedman wrote:

> Murray,
> 
> Is your included code 100% accurate?  I saw this listing in your posted
> web.xml which makes no sense to me:
> 
>  <filter-mapping>
>     <filter-name>HibernateFilter</filter-name>
>     <servlet-name>*.do</servlet-name>
>   </filter-mapping>
> 
> Shouldn't that be:
> 
>  <filter-mapping>
>     <filter-name>HibernateFilter</filter-name>
>     <servlet-name>action</servlet-name>
>     <url-pattern>*.do</url-pattern>
>   </filter-mapping>
> 
> There is no servlet named "*.do".  Your url pattern would probably be the
> "*.do" and your servlet to invoke ("servlet-name") would likely be "action",
> as defined later in your web.xml example file.
> 
> Having a filter which doesn't work correctly might cause connectivity
> problems by failing to set your environment up as you require.
> 
> Regards,
> David
> 
> -----Original Message-----
> From: Murray Collingwood [mailto:murray@focus-computing.com.au]
> Sent: Sunday, October 02, 2005 11:30 PM
> To: user@struts.apache.org
> Subject: [Hibernate] Who owns the problem?
> 
> 
> Hi guys
> 
> I'm getting exceptions with some Hibernate code and when I post on the
> Hibernate
> forum they are claiming it is a Struts issue.  I've read lots of stuff from
> almost
> everywhere and continue to struggle with this implementation.
> 
> Please check out the background (and config/code) at:
> http://forum.hibernate.org/viewtopic.php?p=2264278
> 
> Please let me know if this is a Struts problem or a Hibernate problem.
> Maybe there's a
> simple solution I'm missing?
> 
> Kind regards
> mc
> 
> 
> FOCUS Computing
> Mob: 0415 24 26 24
> murray@focus-computing.com.au
> http://www.focus-computing.com.au
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005
> 



FOCUS Computing
Mob: 0415 24 26 24
murray@focus-computing.com.au
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [Hibernate] Who owns the problem?

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Murray,

I'm with Martin.  I'd be more likely to skip your call to createQuery():

session.createQuery("from com.pancakes.website.controller.form.SectionForm
order by seq").list();

And instead use something like this:

session.find("from SectionForm s order by s.seq").list();

Why?  You shouldn't need the full name and createQuerys are best used if you
have to do things like set parameters, choose min or max results, and so
forth.  Since I'm not seeing that in your query, I recommend using find().
Plus, you shouldn't need the full class name unless you have two object
classes named SectionForm but in different packages.  On top of that, I
recommend putting your query in an XML file as a "Named Query" so you can
update it without having to recompile your java code, should the need ever
arise. Also, you should probably re-read the Hibernate 2.0 (still relevant
in 2.1 and 3.0) tutorial chapter on manipulating data which covers gets,
saves, updates, and the various query types at the url:

http://www.hibernate.org/hib_docs/reference/en/html/manipulatingdata.html

Regards,
David

-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Monday, October 03, 2005 9:42 AM
To: murray@focus-computing.com.au
Cc: Struts Users Mailing List
Subject: Re: [Hibernate] Who owns the problem?


Good Morning Murray-

At first glance
The query parameter in the session.createQuery method does not seem to be
formulated properly and appears not to be SQL92 compliant
based upon the example provided here
http://nhibernate.sourceforge.net/h2.0.3-docs/reference/html/worked-example.
html

Anyone else ?
M-

----- Original Message -----
From: "Murray Collingwood" <mu...@focus-computing.com.au>
To: <us...@struts.apache.org>
Sent: Sunday, October 02, 2005 11:30 PM
Subject: [Hibernate] Who owns the problem?


> Hi guys
>
> I'm getting exceptions with some Hibernate code and when I post on the
> Hibernate
> forum they are claiming it is a Struts issue.  I've read lots of stuff
> from almost
> everywhere and continue to struggle with this implementation.
>
> Please check out the background (and config/code) at:
> http://forum.hibernate.org/viewtopic.php?p=2264278
>
> Please let me know if this is a Struts problem or a Hibernate problem.
> Maybe there's a
> simple solution I'm missing?
>
> Kind regards
> mc
>
>
> FOCUS Computing
> Mob: 0415 24 26 24
> murray@focus-computing.com.au
> http://www.focus-computing.com.au
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [Hibernate] Who owns the problem?

Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Murray-

At first glance
The query parameter in the session.createQuery method does not seem to be 
formulated properly and appears not to be SQL92 compliant
based upon the example provided here
http://nhibernate.sourceforge.net/h2.0.3-docs/reference/html/worked-example.html

Anyone else ?
M-

----- Original Message ----- 
From: "Murray Collingwood" <mu...@focus-computing.com.au>
To: <us...@struts.apache.org>
Sent: Sunday, October 02, 2005 11:30 PM
Subject: [Hibernate] Who owns the problem?


> Hi guys
>
> I'm getting exceptions with some Hibernate code and when I post on the 
> Hibernate
> forum they are claiming it is a Struts issue.  I've read lots of stuff 
> from almost
> everywhere and continue to struggle with this implementation.
>
> Please check out the background (and config/code) at:
> http://forum.hibernate.org/viewtopic.php?p=2264278
>
> Please let me know if this is a Struts problem or a Hibernate problem. 
> Maybe there's a
> simple solution I'm missing?
>
> Kind regards
> mc
>
>
> FOCUS Computing
> Mob: 0415 24 26 24
> murray@focus-computing.com.au
> http://www.focus-computing.com.au
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [Hibernate] Who owns the problem?

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Murray,

Is your included code 100% accurate?  I saw this listing in your posted
web.xml which makes no sense to me:

 <filter-mapping>
    <filter-name>HibernateFilter</filter-name>
    <servlet-name>*.do</servlet-name>
  </filter-mapping>

Shouldn't that be:

 <filter-mapping>
    <filter-name>HibernateFilter</filter-name>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </filter-mapping>

There is no servlet named "*.do".  Your url pattern would probably be the
"*.do" and your servlet to invoke ("servlet-name") would likely be "action",
as defined later in your web.xml example file.

Having a filter which doesn't work correctly might cause connectivity
problems by failing to set your environment up as you require.

Regards,
David

-----Original Message-----
From: Murray Collingwood [mailto:murray@focus-computing.com.au]
Sent: Sunday, October 02, 2005 11:30 PM
To: user@struts.apache.org
Subject: [Hibernate] Who owns the problem?


Hi guys

I'm getting exceptions with some Hibernate code and when I post on the
Hibernate
forum they are claiming it is a Struts issue.  I've read lots of stuff from
almost
everywhere and continue to struggle with this implementation.

Please check out the background (and config/code) at:
http://forum.hibernate.org/viewtopic.php?p=2264278

Please let me know if this is a Struts problem or a Hibernate problem.
Maybe there's a
simple solution I'm missing?

Kind regards
mc


FOCUS Computing
Mob: 0415 24 26 24
murray@focus-computing.com.au
http://www.focus-computing.com.au



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org