[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-26 Thread Derek Chen-Becker
ScalaJPA returns things as either Options or BufferWrappers. The limitation
on entities is due to JPA wanting something implementing the Java Set, List,
Map interfaces and not Scala's. User types are similarly not included in
standard JPA 1.0, although there's talk of putting that into JPA 2.0. I'd
definitely like to address some of these issues, but I'm not enough of a
Scala wizard to work around the JPA limitations (yet) :)

Derek

On Sat, May 23, 2009 at 5:58 AM, Oliver Lambert  wrote:

> When I want to have user defined types, I have to write them as a Hibernate
> hack to JPA - Id rather not be wedded to Hibernate.When I get a collection
> out of a returned entity, I have to use JCL to wrap it. I'd rather, have
> everything in Scala collections.
> When I have a read only entity, I'd like it to be immutable. In fact, maybe
> all entities should be, but thats probably too hard.
> I'm just taking about the lower layer of JPA that Derek's stuff hooks into
> - its OK for Java, it kind of sucks for Scala.
>
> Just my thoughts, don't expect anyone to agree.
>
> cheers
> Oliver
>
> On Sat, May 23, 2009 at 9:41 PM, Timothy Perrett 
> wrote:
>
>>
>> Lol! Sorry oliver... I remember now :)
>>
>> What did you have in mind for “scala solution using JPA”? Is this not what
>> we have already?
>>
>> Cheers, Tim
>>
>>
>> On 23/05/2009 12:33, "Oliver Lambert"  wrote:
>>
>> Yes, I helped with the code!
>>
>> On Sat, May 23, 2009 at 9:28 PM, Timothy Perrett 
>> wrote:
>>
>>
>>
>> To what degree are you wanting to re-invent the wheel? Derek has done
>> amazing work with JPA and Scala - the resulting output being scala-jpa and
>> the jpa archetypes for lift. Are you familiar with them?
>>
>> Cheers, Tim
>>
>> On 23/05/2009 11:56, "Oliver Lambert"  wrote:
>>
>> > JPA is a ORM tool. I think it would be great if someone would create a
>> > Scala solution using JPA as the starting point - any takers?
>> >
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Timothy Perrett
Interesting...

Have you seen jorge's scala utils? Perhaps we could do some magic with  
that to manage translations between java.util.list etc to native scala  
types...?

Cheers, Tim

Sent from my iPhone

On 23 May 2009, at 12:58, Oliver Lambert  wrote:

> When I want to have user defined types, I have to write them as a  
> Hibernate hack to JPA - Id rather not be wedded to Hibernate.
> When I get a collection out of a returned entity, I have to use JCL  
> to wrap it. I'd rather, have everything in Scala collections.
> When I have a read only entity, I'd like it to be immutable. In  
> fact, maybe all entities should be, but thats probably too hard.
> I'm just taking about the lower layer of JPA that Derek's stuff  
> hooks into - its OK for Java, it kind of sucks for Scala.
>
> Just my thoughts, don't expect anyone to agree.
>
> cheers
> Oliver
>
> On Sat, May 23, 2009 at 9:41 PM, Timothy Perrett  > wrote:
>
> Lol! Sorry oliver... I remember now :)
>
> What did you have in mind for “scala solution using JPA”? Is this  
> not what we have already?
>
> Cheers, Tim
>
>
> On 23/05/2009 12:33, "Oliver Lambert"  wrote:
>
> Yes, I helped with the code!
>
> On Sat, May 23, 2009 at 9:28 PM, Timothy Perrett  > wrote:
>
>
> To what degree are you wanting to re-invent the wheel? Derek has done
> amazing work with JPA and Scala - the resulting output being scala- 
> jpa and
> the jpa archetypes for lift. Are you familiar with them?
>
> Cheers, Tim
>
> On 23/05/2009 11:56, "Oliver Lambert"  wrote:
>
> > JPA is a ORM tool. I think it would be great if someone would  
> create a
> > Scala solution using JPA as the starting point - any takers?
> >
>
>
>
>
>
>
>
>
>
>
>
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Oliver Lambert
When I want to have user defined types, I have to write them as a Hibernate
hack to JPA - Id rather not be wedded to Hibernate.When I get a collection
out of a returned entity, I have to use JCL to wrap it. I'd rather, have
everything in Scala collections.
When I have a read only entity, I'd like it to be immutable. In fact, maybe
all entities should be, but thats probably too hard.
I'm just taking about the lower layer of JPA that Derek's stuff hooks into -
its OK for Java, it kind of sucks for Scala.

Just my thoughts, don't expect anyone to agree.

cheers
Oliver

On Sat, May 23, 2009 at 9:41 PM, Timothy Perrett wrote:

>
> Lol! Sorry oliver... I remember now :)
>
> What did you have in mind for “scala solution using JPA”? Is this not what
> we have already?
>
> Cheers, Tim
>
>
> On 23/05/2009 12:33, "Oliver Lambert"  wrote:
>
> Yes, I helped with the code!
>
> On Sat, May 23, 2009 at 9:28 PM, Timothy Perrett 
> wrote:
>
>
>
> To what degree are you wanting to re-invent the wheel? Derek has done
> amazing work with JPA and Scala - the resulting output being scala-jpa and
> the jpa archetypes for lift. Are you familiar with them?
>
> Cheers, Tim
>
> On 23/05/2009 11:56, "Oliver Lambert"  wrote:
>
> > JPA is a ORM tool. I think it would be great if someone would create a
> > Scala solution using JPA as the starting point - any takers?
> >
>
>
>
>
>
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Timothy Perrett

Lol! Sorry oliver... I remember now :)

What did you have in mind for ³scala solution using JPA²? Is this not what
we have already?

Cheers, Tim

On 23/05/2009 12:33, "Oliver Lambert"  wrote:

> Yes, I helped with the code!
> 
> On Sat, May 23, 2009 at 9:28 PM, Timothy Perrett 
> wrote:
>> 
>> 
>> To what degree are you wanting to re-invent the wheel? Derek has done
>> amazing work with JPA and Scala - the resulting output being scala-jpa and
>> the jpa archetypes for lift. Are you familiar with them?
>> 
>> Cheers, Tim
>> 
>> On 23/05/2009 11:56, "Oliver Lambert"  wrote:
>> 
>>> > JPA is a ORM tool. I think it would be great if someone would create a
>>> > Scala solution using JPA as the starting point - any takers?
>>> >  
>> 
>> 
>> 
>> 
> 
> 
> > 
> 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Oliver Lambert
Yes, I helped with the code!

On Sat, May 23, 2009 at 9:28 PM, Timothy Perrett wrote:

>
>
> To what degree are you wanting to re-invent the wheel? Derek has done
> amazing work with JPA and Scala - the resulting output being scala-jpa and
> the jpa archetypes for lift. Are you familiar with them?
>
> Cheers, Tim
>
> On 23/05/2009 11:56, "Oliver Lambert"  wrote:
>
> > JPA is a ORM tool. I think it would be great if someone would create a
> > Scala solution using JPA as the starting point - any takers?
> >
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Timothy Perrett


To what degree are you wanting to re-invent the wheel? Derek has done
amazing work with JPA and Scala - the resulting output being scala-jpa and
the jpa archetypes for lift. Are you familiar with them?

Cheers, Tim

On 23/05/2009 11:56, "Oliver Lambert"  wrote:

> JPA is a ORM tool. I think it would be great if someone would create a
> Scala solution using JPA as the starting point - any takers?
>  



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-23 Thread Oliver Lambert
On Sat, May 23, 2009 at 9:53 AM, braver  wrote:

>
> On May 22, 7:06 pm, Timothy Perrett  wrote:
> > Hey there,
> >
> > Is their a particular reason you wouldn't or couldn't use existing java
> > persistence infrastructure inside your scala application? That's the
> > recommended advice right now; JPA (for instance) will slot right into
> your
> > app :-)
>
> Tim -- thanks for the pointer; as I'm coming to JVM solely for Scala,
> I'm learning the acronyms as I go.  So JPA is good for ORM, right?  My


JPA is a ORM tool. I think it would be great if someone would create a
Scala solution using JPA as the starting point - any takers?


>
> problem is not a typical web app, but rather an intensive warehousing
> -- storing something like a web crawl.  It involves maintaining
> workers stuffing XML into the database, and checking whether a record
> is already there.  I plan to first try it with an RDBMS such as
> PostgreSQL, and/or DB2/Oracle if needed, on a multicore Linux server;


Oracle has a highly performant data warehousing solution, but its a little
costly.


>
> if not enough, I'd explore other solutions such as Berkeley DB or
> distributed HBase.  But first I want to see if "just" JDBC is enough,
> and in order to make sure I get it at its most efficient, I'd like to
> see how the pros do it -- preferably with some Scala goodness so it's
> not as verbose as just Java's.  I saw Dave mention JNDI and found DBCP
> and JNDI-DBCP Howto, and wonder whether it's applicable for high-
> performance apps or is primarily for containers like Tomcat where you
> have to maintain the connection across invocations.  For my purely DB-
> stuffing app, I have connections open in each process; the interesting
> question is, can I unleash e.g. 8 actors, for the 8 cores, and
> leverage JNDI-DBCP pool to make it efficient, or should I simply open
> a connection per actor?
>

I'm don't think the JPA database connection pool requires actors. You can
mix and match JPA for the convenience of an ORM with connection pools
and entity caching with JDBC (and/or native JPA queries) when you require
faster raw SQL performance.


>
> Cheers,
> Alexy
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-22 Thread braver

On May 22, 7:06 pm, Timothy Perrett  wrote:
> Hey there,
>
> Is their a particular reason you wouldn't or couldn't use existing java
> persistence infrastructure inside your scala application? That's the
> recommended advice right now; JPA (for instance) will slot right into your
> app :-)

Tim -- thanks for the pointer; as I'm coming to JVM solely for Scala,
I'm learning the acronyms as I go.  So JPA is good for ORM, right?  My
problem is not a typical web app, but rather an intensive warehousing
-- storing something like a web crawl.  It involves maintaining
workers stuffing XML into the database, and checking whether a record
is already there.  I plan to first try it with an RDBMS such as
PostgreSQL, and/or DB2/Oracle if needed, on a multicore Linux server;
if not enough, I'd explore other solutions such as Berkeley DB or
distributed HBase.  But first I want to see if "just" JDBC is enough,
and in order to make sure I get it at its most efficient, I'd like to
see how the pros do it -- preferably with some Scala goodness so it's
not as verbose as just Java's.  I saw Dave mention JNDI and found DBCP
and JNDI-DBCP Howto, and wonder whether it's applicable for high-
performance apps or is primarily for containers like Tomcat where you
have to maintain the connection across invocations.  For my purely DB-
stuffing app, I have connections open in each process; the interesting
question is, can I unleash e.g. 8 actors, for the 8 cores, and
leverage JNDI-DBCP pool to make it efficient, or should I simply open
a connection per actor?

Cheers,
Alexy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Robust and clear ways to do performant JDBC?

2009-05-22 Thread Timothy Perrett


Hey there,

Is their a particular reason you wouldn't or couldn't use existing java
persistence infrastructure inside your scala application? That's the
recommended advice right now; JPA (for instance) will slot right into your
app :-)

Cheers, Tim  

On 22/05/2009 20:43, "braver"  wrote:

> 
> One of the huge drawbacks in beginning serious use of Scala is the
> lack of an accepted and documented way to talk to the databases such
> as PostgreSQL.  Googling for scala.dbc examples pulls old stuff from
> 2007; there's a scala-query on github, which is promising, and
> abandoned dbc2, and dbc3 is... awaiting new language features!
> 
> Some of my Scala-DB findings are documented in the blog at
> http://la.scala.la/,
> and none look satisfactory so far.
> 
> So it looks like the way to do it right here, right now, is down to
> Java JDBC.  I was glad to see an example of that in @dpp's book.  I
> wonder if you guys can point to specific idioms of using JDBC with
> actors for data-heavy apps such as data mining?  Since Lift is the
> heavy consumer of DBs, I believe you have the most experience with it!
> 
> Cheers,
> Alexy
> 
> > 
> 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---