Re: Timestamp precision question.

2012-06-20 Thread yu wang
Kevin, It does work. Thanks! By the way, what does DatePrecision=1000 mean? Why 1000? Regards, Yu Wang On Tue, Jun 19, 2012 at 10:04 PM, Kevin Sutter kwsut...@gmail.com wrote: Thanks, Yu, for the clarification. By default, OpenJPA uses Millisecond precision on the date fields (least common

Re: Timestamp precision question.

2012-06-20 Thread Kevin Sutter
Good to hear, Yu! It's kind of strange, but the base units used for timestamps are Nanoseconds. So, the DatePrecision specifies what multiplier to use to get the desired precision. Multiply Nanos by 1000 and you get Micros. The default value for DatePrecision is 100, which then translates

Re: Postgres sequence: current transaction is aborted

2012-06-20 Thread Kevin Sutter
Hi John, In this case, Marco was using a database Sequence, not the OpenJPA sequence table. There was an issue with having permissions to alter the Sequence with Postgres. Just wanted to clarify. Thanks! Kevin On Wed, Jun 20, 2012 at 12:57 AM, Boblitz John john.bobl...@bertschi.comwrote:

AW: Postgres sequence: current transaction is aborted

2012-06-20 Thread Boblitz John
Hi Keven, Oh. The same GRANT will work though - no need to play with ownership. Cheers! John -Ursprüngliche Nachricht- Von: Kevin Sutter [mailto:kwsut...@gmail.com] Gesendet: Mittwoch, 20. Juni 2012 15:32 An: users@openjpa.apache.org Betreff: Re: Postgres sequence: current

Re: How to enable cascade-persistence globally

2012-06-20 Thread Rick Curtis
Waruna - Can you try setting this property ? openjpa.Compatibility=CheckDatabaseForCascadePersistToDetachedEntity=false Thanks, Rick On Wed, Jun 20, 2012 at 12:08 AM, Waruna Ranasinghe waruna...@gmail.comwrote: Hi Rick, I tried setting the CascadeType.ALL, then I get the following

Re: AW: Postgres sequence: current transaction is aborted

2012-06-20 Thread Marco de Booij
Hi Kevin, You answered for me but I want to clarify it for John. The GRANT SELECT, UPDATE, INSERT, DELETE only works for data in a table (For a sequence you only need SELECT and UPDATE). The solution in openJPA for the sequence involves a change in the definition of the SEQUENCE. In

Re: AW: Postgres sequence: current transaction is aborted

2012-06-20 Thread Kevin Sutter
Hi Marco, Yes, I am updating the OpenJPA-2196 JIRA with pertinent information from this discussion. Thanks for your help in debugging the issue(s). Kevin On Wed, Jun 20, 2012 at 10:42 AM, Marco de Booij mdeb...@scarlet.be wrote: Hi Kevin, You answered for me but I want to clarify it for

Re: Change of MappingDefaults breaks OPENJPA_SEQUENCE_TABLE

2012-06-20 Thread Dianne Richards
Hi Alexey - I was able to reproduce this problem with a simple test case and debug it. I think you can get what you want by changing the following line in your ImprovedMappingDefaults: DBIdentifier.newColumn(col.getIdentifier().getName(), true); Change the true to false. What's happening is the

Re: Change of MappingDefaults breaks OPENJPA_SEQUENCE_TABLE

2012-06-20 Thread Dianne Richards
Oops - I just looked more closely at the output, and it's not what you want. I'll keep going. Dianne On Wed, Jun 20, 2012 at 11:53 AM, Dianne Richards diann...@gmail.comwrote: Hi Alexey - I was able to reproduce this problem with a simple test case and debug it. I think you can get what you

Re: Change of MappingDefaults breaks OPENJPA_SEQUENCE_TABLE

2012-06-20 Thread Dianne Richards
ok - Here's what I think you should do. First, set the delimit value to false in the newColumn() call, as I indicated in a previous post. Then, switch the statements for assigning validName and correctedName. Here's an example: public class ImprovedMappingDefaults extends

Re: How to enable cascade-persistence globally

2012-06-20 Thread Waruna Ranasinghe
Hi Rick, after setting openjpa.Compatibility=CheckDatabaseForCascadePersistToDetachedEntity=*true* The issue is fixed. Thanks a lot for the help. Thanks, Waruna On 20 June 2012 19:24, Rick Curtis curti...@gmail.com wrote: Waruna - Can you try setting this property ?

Re: How to enable cascade-persistence globally

2012-06-20 Thread Rick Curtis
Waruna - Glad to hear that it solved your problem... but I'm still interested in what was going on. Would you be able to put together a small unit test that recreates this issue? I'd like to dig in to make sure that there isn't still a bug in OpenJPA code. Thanks, Rick On Wed, Jun 20, 2012 at

Re: Change of MappingDefaults breaks OPENJPA_SEQUENCE_TABLE

2012-06-20 Thread Alexey Romanov
Yes, that was one of things I've tried, but I much prefer lowercase for identifiers in SQL to make it more readable :) And I've decided that complicating my MappingDefaults for it slightly is a good tradeoff. One more complication was that in the OSGi setting I had to add a fragment to the

Problems with MappingTool runtime synchronization and Turkish locale

2012-06-20 Thread Mike Goldner
I have an issue with the MappingTool when the computer locale is set to Turkish. This is a pretty well known locale quirk and I see that a sqlEncode flag was added to MappingTool which would override the default locale. Unfortunately, when runtime synchronization is configured in the

Re: Timestamp precision question.

2012-06-20 Thread yu wang
Kevin, So if I need nanosecond, the Date precision should be 1,right? Regards, Yu Wang On Wed, Jun 20, 2012 at 9:28 PM, Kevin Sutter kwsut...@gmail.com wrote: Good to hear, Yu! It's kind of strange, but the base units used for timestamps are Nanoseconds.  So, the DatePrecision specifies what