Re: [Hibernate] long duration transactions

2003-11-17 Thread Christian Bauer
On 18 Nov (02:07), dosapati wrote: > When I use Hibernate session for long duration transactions, Can I > disconnect the SQL > connection from the session without committing and reconnect again when I > need. And finally > will commit the transaction after all the actions with the system. I will >

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
It does not pose much of a problem for the grammar, especially if the tokens are such that this can be done with the lexer. Then it is simply a matter of plugging in the pass through token into the grammar where it is appropriate (e.g. as an expression 'atom'). Don't know what it means for the ba

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
--- Chris Nokleberg <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2003 at 11:54:54AM -0800, Joshua > Davis wrote: > I suppose you could do something like > raw "current date" > > So 'raw' becomes a keyword that modifies the next > token. Yes. Users of an old system that I worked on that transla

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
--- "Les A. Hazlewood" <[EMAIL PROTECTED]> wrote: > > have a prefix that indicates it should flow > through into the resulting > > xml > > I think you meant resulting sql, right? ;) > Errr... yeah. Did somebody say XML? __ Do you Yahoo!? Protect your identity wi

Re: [Hibernate] long duration transactions

2003-11-17 Thread dosapati
When I use Hibernate session for long duration transactions, Can I disconnect the SQL connection from the session without committing and reconnect again when I need. And finally will commit the transaction after all the actions with the system. I will rollback If I get any problems in the transacti

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Les A. Hazlewood
> have a prefix that indicates it should flow through into the resulting > xml I think you meant resulting sql, right? ;) Les --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer fr

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Chris Nokleberg
On Mon, Nov 17, 2003 at 11:54:54AM -0800, Joshua Davis wrote: > That's a neat idea. So, 'raw:' would be a > pass-through that would pass things directly to the > underlying engine. The only issue there is when the > underlying syntax does not obey the rules of the > over-arching grammar (e.g. 'cu

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Les A. Hazlewood
> I would rather you go the other way, i.e. unprefixed functions should be > portable ANSI-derived aliases which are mapped by the dialects to the > necessary names. For driver-specific functions you could potentially > have a prefix that indicates it should flow through into the resulting > xml, e

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
The preprocessor approach might be redundant if I can get the grammar to recognize the old syntax. Of course, that's a medium sized 'if' there. --- Gavin King <[EMAIL PROTECTED]> wrote: > I think this is our plan. Any insurmountable > problems with that, do you > think? > > (Devils in the detai

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
LOL! Ya know what? I had implemented this *exact same* tranform back when I was writing a 4GL compiler at work. This one's easy though: ident '('[METHOD_CALL] expr => expr '.' ident '('[METHOD_CALL] Especially since parens are not use for array subscripts, like they were in the 4GL. :-P I'll

Re: [Hibernate] long duration transactions

2003-11-17 Thread Christian Bauer
On 18 Nov (00:17), dosapati wrote: > Is it possible to use Hibernate in long duration transactions. Where the transaction > can be across user interactions with the system. Can span minutes, days or months. > How can I use Hibernate session for this purpose? Do I need any additional software > fo

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Chris Nokleberg
On Mon, Nov 17, 2003 at 01:05:50PM -0500, Les A. Hazlewood wrote: > > How about we get a list of ANSI-standard SQL functions and portably > > support those and those only (I don't think there are many of them). > > This makes a lot of sense. However, what if something so commonly used (like a > c

[Hibernate] long duration transactions

2003-11-17 Thread dosapati
Is it possible to use Hibernate in long duration transactions. Where the transaction can be across user interactions with the system. Can span minutes, days or months. How can I use Hibernate session for this purpose? Do I need any additional software for this in addition to Hibernate?  

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Les A. Hazlewood
> How about we get a list of ANSI-standard SQL functions and portably > support those and those only (I don't think there are many of them). This makes a lot of sense. However, what if something so commonly used (like a current_timestamp() function) is not part of the ANSI standard (assuming ANSI

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Gavin King
I think this is our plan. Any insurmountable problems with that, do you think? (Devils in the details, obviously.) We might almost be able to replace the hql package with a preprocessor/postprocessor that predigests the query into a form that the new parser can swallow. I don't think this is i

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Gavin King
How about we get a list of ANSI-standard SQL functions and portably support those and those only (I don't think there are many of them). David Channon wrote: I think limited application of aliases would be beneficial but query substitutions would work in many situations. The current date issue I

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Gavin King
breaking to much existing code. Don't want to do this lightly. Is this step with the new parser and possible changes to the supported syntax a Version 3 option? I think so. No. we need this now. The longer we stay with the existing parser, the harder it becomes to ditch it in the long run. We

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Christian Bauer
On 18 Nov (00:47), David Channon wrote: > Postgress= now() Thats good. > breaking to much existing code. Don't want to do this lightly. Is this step > with the new parser and possible changes to the supported syntax a Version 3 > option? I think so. -- Christian Bauer [EMAIL PROTECTED]

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread David Channon
I think limited application of aliases would be beneficial but query substitutions would work in many situations. The current date issue I am not sure that it is one of them. I am guilty of having not tried hibernate.query.substitutions on this level. I am not sure you can use this to deal with the

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Gavin King
Another thought. Would it be nice to be able to express: upper(customer.name) as the more object-oriented: customer.name.upper() How hard would this be to implement in the parser? Especially, how hard would it be to make the parser spit out the exact same AST in either case? -- Gavin K

RE: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
Sounds like a reasonable compromise, as making the grammar a superset of all proprietary grammars is also on the ambitious side (done this before, it was horribly arcane and fragile... twitch-twitch). Just thinking out loud here... maybe some form of pass-through quoting would be an elegant way to

RE: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
No problem. I'll just make 'by' optional. There goes my idea about making multi-word keywords! LOL! Seriously though, 'having' is a sub-clause of group still, right? I could make the nodes appear on the same level without much effort if you prefer. I figured the writers of the 'group' analysis

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Gavin King
I don't think we are realistically going to be able to dream up portable aliases for everything. I can see an argument for doing it for a couple of very important cases like current date. Beyond that I wouldn't really like to go there. Note that you can't have both really ... as soon as you hav

RE: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
David, Excelent point. It looks like a design decision is required here (i.e. portable aliases vs. proprietary pass-through). Personally, I like the idea of portable aliases for special features, as I'm not sure how I'm going to plug Hibernate's dialect information into the parser. It's probably

RE: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
Christian, Thanks for the idea. Just tried it... new with any expr list, including subqueries are parsed. The AST came out a little funny at first, but I fixed that using a new 'CONSTRUCTOR' node type (first sub-node is the class, subsequent nodes are the argument list). input: ->select new Foo(c

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Gavin King
Finally, why is the "having" node a submode of the "group" node? Because it is a dependent sub-clause of 'group by' at the moment. Is that not the case? H. I suppose it is. well, as long as we can support from . where group having . as well as the traditional from .

RE: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Joshua Davis
Responses below > -Original Message- > From: Gavin King [mailto:[EMAIL PROTECTED] > Sent: Monday, November 17, 2003 6:50 AM > > -- Grammar problem #1: The 'from Order order where' examples -- > > > > Also, notice that I changed 'order' to 'ord' in many of the HQL > > examples in the

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Christian Bauer
On 18 Nov (00:05), Gavin King wrote: > Does the parser handle: > > * subselects (can't notice one anywhere) > * floating point and decimal literals > (it doesn't need to parse them, just recognize them) I'd also plan for "select new Foo(count(bar))". > This is the "implicit group by" we discu

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Gavin King
Does the parser handle: * subselects (can't notice one anywhere) * floating point and decimal literals (it doesn't need to parse them, just recognize them) We also want to plan for the following new syntax: select foo, count(bar) from Foo foo outer join foo.bars bar group This is the "imp

Re: [Hibernate] Re: AST parser for HQL

2003-11-17 Thread Gavin King
-- Grammar problem #1: The 'from Order order where' examples -- Also, notice that I changed 'order' to 'ord' in many of the HQL examples in the hibernate documentation. This is because 'order' is a keyword, and the statement: Don't worry. Just outlaw keywords as identifiers. The reality is that