Re: How to release db connection into pool?

2010-01-21 Thread wang yu
Craig, I have tested it. It's cool! The db connection will be returned into pool and I can reuse the JPAEntityManager! Thanks again. Regards, Yu Wang On Fri, Jan 22, 2010 at 9:57 AM, wang yu wangy...@gmail.com wrote: Craig: Thank you for your quick response. If I close it, the connection

Re: How to encrypt DB password in persistence.xml

2009-09-01 Thread wang yu
) and minor (1.3.0) versions of OpenJPA. In the mean time you can grab a nightly build from the builds pagehttp://openjpa.apache.org/downloads.html (look for 2.0.0-SNAPSHOT). I'll  try to get the fix ported to 1.3.0 this weekend too. -mike On Thu, Aug 13, 2009 at 8:58 PM, wang yu wangy

Re: How to encrypt DB password in persistence.xml

2009-08-13 Thread wang yu
you have written the encryption code in your extension for DBCP so it should be fairly easy to wrap in an encryption provider. Hope this helps, -mike On Fri, Aug 7, 2009 at 1:25 AM, wang yu wangy...@gmail.com wrote: Rick, Thank you for your information. I have resolved this issue

Re: How to encrypt DB password in persistence.xml

2009-08-07 Thread wang yu
Rick, Thank you for your information. I have resolved this issue by modifying dbcp source code. The bad part is dbcp can be built with jdk 1.4 only which made build system little bit complicated:-) If you can deliver encryption feature in next release, I'll be very pleased to use it. Regards, Yu

Re: Timestamp in JPQL where clause issue

2009-07-28 Thread wang yu
Pinaki, Yes ,you're right. Thanks! Yu Wang On Mon, Jul 27, 2009 at 8:32 PM, Pinaki Poddarppod...@apache.org wrote: Hi,  Can you please change the parameter name from to something else? The error is during parse and may have be related to the fact that from is a reserved word in JPQL.

Timestamp in JPQL where clause issue

2009-07-27 Thread wang yu
Hello, I met an OpenJPA Timestamp filed in JPQL where clause issue. I used it as: EntityManagerFactory factory = Persistence.createEntityManagerFactory( test, System.getProperties()); String sql= SELECT callpath FROM

Re: Timestamp in JPQL where clause issue

2009-07-27 Thread wang yu
And I used OpenJPA 1.2.1. -Yu Wang On Mon, Jul 27, 2009 at 2:20 PM, wang yuwangy...@gmail.com wrote: Hello, I met an OpenJPA Timestamp filed in JPQL where clause issue. I used it as:                EntityManagerFactory factory = Persistence.createEntityManagerFactory(                      

Re: Exception of merge method.

2009-07-14 Thread wang yu
after closing the original context (if so there are other properties that you may need to set). -mike On Tue, Jul 14, 2009 at 3:21 AM, wang yu wangy...@gmail.com wrote: Hello, I uses OpenJPA 1.2.1. Even if I add @Version annotation for the entity class,It doesn't work. Every time

Foreign key error if using GenerationType.AUTO or GenerationType.TABLE

2009-06-22 Thread wang yu
Hello, If I use GenerationType.AUTO or GenerationType.TABLE for PK field and let OpenJPA persist some entities cascade , in some cases, OpenJPA will try to persist child entity before the father entity. How to resolve this issue? I must use GenerationType.AUTO for oracle because it doesn't

Re: Foreign key error if using GenerationType.AUTO or GenerationType.TABLE

2009-06-22 Thread wang yu
but it should help for your scenario. [1] http://issues.apache.org/jira/browse/OPENJPA-817 -mike On Mon, Jun 22, 2009 at 6:03 AM, wang yu  wrote: Hello, If I use GenerationType.AUTO or GenerationType.TABLE for PK field and let OpenJPA persist some entities cascade , in some cases, OpenJPA

Re: ID field auto generation issue for multiple databases supporting

2009-06-18 Thread wang yu
Hi Milosz, Yes, you're right. And I have checked the source code, the AUTO is total identical with TABLE in OpenJPA. Thank you for your patient help! Regards, Yu Wang On Wed, Jun 17, 2009 at 6:02 PM, Miłosz Tylendamtyle...@o2.pl wrote: Hi Yu Wang, The error message seems to say Attempt to

Re: For oracle11g , setting openjpa.ConnectionUserName and openjpa.ConnectionPassword in java code error.

2009-06-17 Thread wang yu
Hi, Anybody else has tried this? Regards, Yu Wang On Thu, Jun 11, 2009 at 4:54 PM, wang yuwangy...@gmail.com wrote: Hi, I guess it's a bug of OpenJPA 1.2.1. I used ojdbc6.jar to connect oracle11g. If I pass username and password in persistence.xml, everything will be OK. But if I pass them

Re: ID field auto generation issue for multiple databases supporting

2009-06-14 Thread wang yu
Milosz, I have tried @GeneratedValue(strategy=GenerationType.AUTO), it works fine for oracle but doesn't work for Derby. Regards, Yu Wang On Sat, Jun 13, 2009 at 7:19 PM, Miłosz Tylendamtyle...@o2.pl wrote: Yu Wang, Try using @GeneratedValue(strategy=GenerationType.AUTO). This should

ID field auto generation issue for multiple databases supporting

2009-06-11 Thread wang yu
Hello, I found If I user derby, I need to use @GeneratedValue(strategy=GenerationType.IDENTITY) for ID field. And for oracle database, I need to use @GeneratedValue(strategy=GenerationType.SEQUENCE). The question is if I want to use same entity classes to support both derby and oracle, how should

Re: OpenJPA reconnect derby database issue.

2009-06-07 Thread wang yu
it look like it's handing out the EntityManager that is being used. -mike On Fri, Jun 5, 2009 at 2:44 AM, wang yu wangy...@gmail.com wrote: Hello, My application uses Tomcat6,derby,spring and OpenJPA 1.20. My case is stopping derby database and restarting it. And I found even if I catch

OpenJPA reconnect derby database issue.

2009-06-05 Thread wang yu
Hello, My application uses Tomcat6,derby,spring and OpenJPA 1.20. My case is stopping derby database and restarting it. And I found even if I catch the database connection broken exception and create an new EntityManager successfully after derby restarts, the following exception stack will be

Re: How to encrypt DB password in persistence.xml

2009-05-19 Thread wang yu
/dbcp/ On Mon, May 18, 2009 at 2:47 AM, wang yu wangy...@gmail.com wrote: Hi Kevin, Thanks. The link you gave indicate how to extend BasicDataSourceFactory. But I guess this approach isn't feasible for OpenJPA. I need to extend BasicDataSource directly, right? And you mentioned there were other

Re: How to encrypt DB password in persistence.xml

2009-05-18 Thread wang yu
-resource-defi On Fri, May 15, 2009 at 2:33 AM, wang yu wangy...@gmail.com wrote: Hi Kevin, Thank you. You had real good solutions but unfortunately neither of them is feasible for our project. We use Apache dbcp datasource to leverage DB connection pool and tomcat 5.5 as app server

Re: How to encrypt DB password in persistence.xml

2009-05-15 Thread wang yu
it in a persistence.xml.  Or, if you are in an app server environment, you should use a jndi lookup of a datasource.  This would be the most secure. Kevin On Tue, May 12, 2009 at 4:31 AM, wang yu wangy...@gmail.com wrote: As title. Regards, Yu Wang

How to encrypt DB password in persistence.xml

2009-05-12 Thread wang yu
As title. Regards, Yu Wang

Re: apache-openjpa-1.0.2 performance degrade under long-run press testing

2008-03-24 Thread wang yu
\persistence.xml/ classpath pathelement location=${builddir}/ /classpath fileset dir=${builddir} includes=$**/*.class/ /openjpac /target On Fri, Mar 14, 2008 at 11:03 AM, wang yu [EMAIL PROTECTED] wrote: Hello, I met one performance issue

Re: apache-openjpa-1.0.2 performance degrade under long-run press testing

2008-03-19 Thread wang yu
the problem is resolved. On Fri, Mar 14, 2008 at 11:03 AM, wang yu [EMAIL PROTECTED] wrote: Hello, I met one performance issue with apache-openjpa-1.0.2. My environment includes apache-openjpa-1.0.2,db-derby-10.3.2.1-bin,and apache-tomcat-5.5.26. Below is the openjpa-related properties