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 wrote: > Craig: > Thank you for your quick response. > If I close it, the connection wi

Re: How to release db connection into pool?

2010-01-21 Thread wang yu
 conn.close(); > > Regards, > > Craig > On Jan 21, 2010, at 1:26 AM, wang yu wrote: > >> Gurus: >> I use OpenJPA 1.2.1 and dbcp: >>                        > >>  value="org.apache.commons.dbcp.BasicDataSource" /> >>                      

How to release db connection into pool?

2010-01-21 Thread wang yu
Gurus: I use OpenJPA 1.2.1 and dbcp: And I found the connection pool worked perfect for JPA query. But if I use JDBC query like following: OpenJPAEntityManager open_manager = OpenJPAPersistence

Re: How to encrypt DB password in persistence.xml

2009-09-01 Thread wang yu
e next major (2.0.0) and minor (1.3.0) versions of > OpenJPA. > > In the mean time you can grab a nightly build from the builds > page<http://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.

Re: How to encrypt DB password in persistence.xml

2009-08-13 Thread wang yu
point for other tools. > > It sounds like 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 wrote: > >> Rick, &

Re: How to encrypt DB password in persistence.xml

2009-08-06 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 Poddar 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. > > > > - >

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 yu wrote: > Hello, > I met an OpenJPA Timestamp filed in JPQL where clause issue. > I used it as: >                EntityManagerFactory factory = > Persistence.createEntit

Timestamp in JPQL where clause issue

2009-07-26 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 FRO

Re: Exception of merge method.

2009-07-14 Thread wang yu
loaded (ie not set after detaching). Did you serialize the entity 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 wrote: > >> Hello, >> I uses OpenJPA 1.2.1. >

Re: Exception of merge method.

2009-07-14 Thread wang yu
ntext? Regards, Yu Wang On Mon, Jul 13, 2009 at 5:44 PM, wang yu wrote: > Hello, > My case is: > 1. Find an entity and close the context. > 2. Update it with user input. > 3. Create a new EntityManager and try to merge it into new context. > > Then the foll

Exception of merge method.

2009-07-13 Thread wang yu
Hello, My case is: 1. Find an entity and close the context. 2. Update it with user input. 3. Create a new EntityManager and try to merge it into new context. Then the following exception was thrown: org.apache.openjpa.persistence.InvalidStateException: The generated value processing detected an

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

2009-06-24 Thread wang yu
it should work on the > EMFactory but not with the EM. > > -mike > > On Wed, Jun 17, 2009 at 4:21 AM, wang yu wrote: > >> Hi, >> Anybody else has tried this? >> >> Regards, >> Yu Wang >> >> On Thu, Jun 11, 2009 at 4:54 PM, wang yu wrote: &g

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 Genera

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 support

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 Tylenda wrote: > Hi Yu Wang, > > The error message seems to say "Attempt to modify an id

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 yu 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 i

Re: ID field auto generation issue for multiple databases supporting

2009-06-17 Thread wang yu
Hello Milosz, I found OpenJpa created table OPENJPA_SEQUENCE_TABLE automatically in the runtime, following is a fragment of my log file: 44048 xxx TRACE [Persistence-thread-0] openjpa.jdbc.SQL - executing prepstmnt 25906379 SELECT SEQUENCE_VALUE FROM xxx.OPENJPA_SEQUENCE_TABLE WHERE ID = ? FOR

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 Tylenda wrote: > Yu Wang, > > Try using "@GeneratedValue(strategy=GenerationType.AUTO)". This should > automaticall

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 sho

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

2009-06-11 Thread wang yu
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 from java code like below, the connecting will fail: map.put("openjpa.ConnectionUserName","tsam");

Re: OpenJPA reconnect derby database issue.

2009-06-09 Thread wang yu
g/builds/latest/docs/manual/manual.html#ref_guide_dbsetup_retain > > Hope this helps, > -mike > > > > On Mon, Jun 8, 2009 at 12:22 AM, wang yu wrote: > >> Hi Mike, >> Following is how I close cache: >> >>                         >>              

Re: OpenJPA reconnect derby database issue.

2009-06-07 Thread wang yu
you close the cache of OpenJPA EntityManagers? I have very little > experience with Spring, but the stack makes 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 wrote: > >> Hello, >> My

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 print

Re: How to encrypt DB password in persistence.xml

2009-05-19 Thread wang yu
hanks. > > Kevin > > [1]  http://commons.apache.org/dbcp/ > > On Mon, May 18, 2009 at 2:47 AM, wang yu wrote: > >> Hi Kevin, >> Thanks. >> The link you gave indicate how to extend BasicDataSourceFactory. But I >> guess this approach isn't feasibl

Re: How to encrypt DB password in persistence.xml

2009-05-18 Thread wang yu
> http://stackoverflow.com/questions/129160/how-to-avoid-storing-passwords-in-the-clear-for-tomcats-server-xml-resource-defi > > > > On Fri, May 15, 2009 at 2:33 AM, wang yu wrote: > >> Hi Kevin, >> Thank you. You had real good solutions but unfortunately neither of >

Re: How to encrypt DB password in persistence.xml

2009-05-15 Thread wang yu
, 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 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
your ant file like below: 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.

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. > > Belo

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

2008-03-13 Thread wang yu
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 defined in the persistnce.xml: And there is my