You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gustavo Cebrian <gu...@greenhatconsulting.com> on 2003/05/06 12:20:32 UTC

RE: [ot] JavaBean persistence design advice

I do not understand exactly.

Probably we should distinguish.
Apparently, there is a way to store information from a Session.

My question is? When do you want to use this? Usually, I just store information in my database
whenever I get the information from the parametres or JavaBeans. We should distinguish. As far as I know, Java Beans is just a cool/quick way to get information from a form into a java class.Enterprise 
Java Beans is something else.

My advice, I do not have very good experience using Enterprice Java Beans, but they sound to me like the best option. That way you do not worry about 'Pool connection' etc.



Gustavo.


***********************************************
Gustavo Cebrian
Analyst/Programmer

Want to improve the ROI on your EAI project?
Download RV Tester and reduce your development 
and testing timescales by as much as 50%. 
http://www.greenhatconsulting.com/rvtester 

Green Hat Consulting Ltd.
107 Fleet Street, London EC4A 2AB
DDI +44 (0)20 7936 9495
Mobile +44 (0)7788 922291
http://www.greenhatconsulting.com
gustavo.cebrian@greenhatconsulting.com
***********************************************




-----Original Message-----
From: Kevin D'Elia [mailto:kevinmail@comcast.net]
Sent: 30 April 2003 15:42
To: Tomcat Users List
Subject: Re: [ot] JavaBean persistence design advice


I'm working with Tomcat 4.1 and have set up the PersistenceManager to 
store session information to the filesystem; there's support for JDBC as 
well, although I haven't done that myself (yet).  Also, I am playing 
around with the session replication feature that will be available in 
5.x from what I understand, but can be retrofitted into a 4.x installation.

HTH

Kevin D'Elia

Erik Price wrote:

> Hi,
>
> I am not using EJB or any kind of managed persistence in my webapp 
> (though Torque looks pretty cool).  What is a recommended and not too 
> complex means to store simple JavaBeans to a DB?  I currently have a 
> "store()"-like method in my JavaBeans so that they can persist 
> themselves, but I thought I heard once (I forget where) that this is a 
> design antipattern.
>
> What do others use?
>
>
> Regards,
> Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



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



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


Re: [ot] JavaBean persistence design advice

Posted by Erik Price <ep...@ptc.com>.
Well, I have classes to describe "value objects" in the application I am 
working on.  For instance, users can make a budget request, so I have a 
class called BudgetRequestBean.  It just happens to be a JavaBean in 
addition to being a normal class, because I've followed the JavaBean 
conventions.  While I do use the <jsp:useBean> shortcuts from JSP to 
display the BudgetRequestBean instance's information/data, the instance 
is also used from servlets, etc.  So I was just curious to hear how 
other people actually perform the process of persisting the object to 
the database.  Kevin mentioned using PersistenceManager for session 
data, and I mentioned that I had a method of the object "store()" or 
somesuch that does the work involved.  In other words, what mechanism do 
you use to put your object into the DB?

(There is a really cool project called Torque 
<http://db.apache.org/torque/> that does persistence automatically, but 
I have not yet incorporated it into my app.  I am considering it, though.)


Erik




Gustavo Cebrian wrote:
> I do not understand exactly.
> 
> Probably we should distinguish.
> Apparently, there is a way to store information from a Session.
> 
> My question is? When do you want to use this? Usually, I just store information in my database
> whenever I get the information from the parametres or JavaBeans. We should distinguish. As far as I know, Java Beans is just a cool/quick way to get information from a form into a java class.Enterprise 
> Java Beans is something else.
> 
> My advice, I do not have very good experience using Enterprice Java Beans, but they sound to me like the best option. That way you do not worry about 'Pool connection' etc.
> 
> 
> 
> Gustavo.
> 
> 
> ***********************************************
> Gustavo Cebrian
> Analyst/Programmer
> 
> Want to improve the ROI on your EAI project?
> Download RV Tester and reduce your development 
> and testing timescales by as much as 50%. 
> http://www.greenhatconsulting.com/rvtester 
> 
> Green Hat Consulting Ltd.
> 107 Fleet Street, London EC4A 2AB
> DDI +44 (0)20 7936 9495
> Mobile +44 (0)7788 922291
> http://www.greenhatconsulting.com
> gustavo.cebrian@greenhatconsulting.com
> ***********************************************
> 
> 
> 
> 
> -----Original Message-----
> From: Kevin D'Elia [mailto:kevinmail@comcast.net]
> Sent: 30 April 2003 15:42
> To: Tomcat Users List
> Subject: Re: [ot] JavaBean persistence design advice
> 
> 
> I'm working with Tomcat 4.1 and have set up the PersistenceManager to 
> store session information to the filesystem; there's support for JDBC as 
> well, although I haven't done that myself (yet).  Also, I am playing 
> around with the session replication feature that will be available in 
> 5.x from what I understand, but can be retrofitted into a 4.x installation.
> 
> HTH
> 
> Kevin D'Elia
> 
> Erik Price wrote:
> 
> 
>>Hi,
>>
>>I am not using EJB or any kind of managed persistence in my webapp 
>>(though Torque looks pretty cool).  What is a recommended and not too 
>>complex means to store simple JavaBeans to a DB?  I currently have a 
>>"store()"-like method in my JavaBeans so that they can persist 
>>themselves, but I thought I heard once (I forget where) that this is a 
>>design antipattern.
>>
>>What do others use?
>>
>>
>>Regards,
>>Erik
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


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