Re: [Dbix-class] Race condition in find_or_create()

2008-08-25 Thread Tobias Kremer
Quoting Matt S Trout <[EMAIL PROTECTED]>: > On Mon, Aug 04, 2008 at 10:32:31AM +0200, Tobias Kremer wrote: > > Quoting Ash Berlin <[EMAIL PROTECTED]>: > > > A method on the storage object (which is subclassed to be the > > > particular type of DBI you

Re: [Dbix-class] Race condition in find_or_create()

2008-08-07 Thread Tobias Kremer
Guys, any comments on how we are going to pull this off would be greatly appreciated :) Thanks! --Tobias Quoting Tobias Kremer <[EMAIL PROTECTED]>: > Quoting Ash Berlin <[EMAIL PROTECTED]>: > > A method on the storage object (which is subclassed to be the > > par

Re: [Dbix-class] Race condition in find_or_create()

2008-08-04 Thread Tobias Kremer
Quoting Ash Berlin <[EMAIL PROTECTED]>: > A method on the storage object (which is subclassed to be the > particular type of DBI you are connecting to, eg > DBIx::Class::Storage::DBI::mysql) which parses and encapsulates the > error as returned from the database to mark its type, e.g. FK > constrai

[Dbix-class] Race condition in find_or_create()

2008-07-30 Thread Tobias Kremer
() to a single query in the best case. On Tue, Jul 29, 2008 at 12:49:17PM +0200, Tobias Kremer wrote: Maybe it'd be better to ditch find_or_create in favor of something like this: eval { $row = $self->model->create( { ... } ); } if( $@ && $@ =~ /duplicate/ ) { # the quest

Re: [Dbix-class] Re: Versioned Cluelessness

2008-07-28 Thread Tobias Kremer
Hi Jerry, Quoting Jerry Kaidor <[EMAIL PROTECTED]>: > this catalyst/DBIC stuff ( BTW, what's the difference between DBIx and > DBIC? Is > DBIx just DBI - any-kind-of-X? ). Before you're getting shot down for this question, I'll quickly jump in with an answer :) DBIx is just a (CPAN) namespace fo

Re: [Dbix-class] Re: Versioned Cluelessness

2008-07-28 Thread Tobias Kremer
On 28.07.2008, at 04:01, Christopher Laco wrote: is not an appropriate answer for a new user or Catalyst or DBIC. It's an attitude. Why isn't that part of dbicadmin? Why doesn't Cat roll that into script/? Why doesn't a fresh Cat app automatically create MyApp::Schema, or at least make it ea

[Dbix-class] Storing ResultSets in the schema

2008-07-07 Thread Tobias Kremer
On server startup I'd like to fetch the complete data of one table and store it somewhere to allow faster retrieval of it later on. For this, I have added an attribute to my DBIC schema class which is set during server startup with the result of my ResultSet->search operation. Basically the data s

Re: [Dbix-class] DBIx::Class and caching

2008-07-03 Thread Tobias Kremer
Quoting Oleg Pronin <[EMAIL PROTECTED]>: > Of course when your project is not popular or you never run benchmark on > what you write, you have no matter. This all depends on what you're caching. If your query runs for 0.001 seconds there maybe is no need to cache it and doing so might indeed have

Re: [Dbix-class] DBIx::Class and caching

2008-07-03 Thread Tobias Kremer
Quoting Andreas Pronakis <[EMAIL PROTECTED]>: > I was wondering if anyone has tried using the module > DBIx::Class::Cursor::Cached but replacing the cache engine Cache::FileCache > with Memcache? Yes, we're using it in production for a site serving approx. 10 million pageimpressions/month and it

Re: [Dbix-class] How to use a model with a different table name

2008-06-23 Thread Tobias Kremer
Quoting Emmanuel Quevillon <[EMAIL PROTECTED]>: > I have a module DB::GenericTable.pm which reflects a > 'generic' table schema into my database associated to a > table name in the DB. > I'd like to kow how can I access another table (different > name) but with the same schema (same column name, sa

Re: [Dbix-class] Help with Arbitrary SQL through a custom ResultSource

2008-03-11 Thread Tobias Kremer
Quoting Steve Kirkup <[EMAIL PROTECTED]>: > I guess, I don't understand what the subquery is supposed to encompass. > My SQL is basically > SELECT * FROM Table INNER JOIN Sub_Table ON ( Table.id = Sub_Table.id ) > WHERE Table.id = '1' > Does this mean I should drop the 'SELECT * FROM ' from the SQL

Re: [Dbix-class] how to search by date?

2008-01-14 Thread Tobias Kremer
Am 15.01.2008 um 00:13 schrieb Michael Higgins: Shouldn't this datetime cast/conversion thing be automagical? eval { $rs = $schema->resultset('DB::DATA')->search( {Name => {'like', $name_like}, "the date" => \"= cast ('01/4/2008' as datetime)"

Re: [Dbix-class] Resultset with memcached

2008-01-10 Thread Tobias Kremer
Quoting Moritz Onken <[EMAIL PROTECTED]>: > I think there is no big difference in speed between the query cache of > a dbms like mysql and a memcache query. > Try disabling the query cache in your dbms to see the performance > impact. The MySQL query cache gets invalidated as soon as changes to a

RE: [Dbix-class] Resultset with memcached

2008-01-10 Thread Tobias Kremer
Quoting [EMAIL PROTECTED]: > Actually, I think that the bottleneck in my case here is the time it takes to > perform database queries. I haven't tried DBIx::Class::Cursor::Cached yet, The bottleneck almost always is the database :) > but looking at the posts, it seems more appropriate for me than

RE: [Dbix-class] Resultset with memcached

2008-01-09 Thread Tobias Kremer
> Couldn't render template "undef error - Can't call method "source" on an > undefined value at > /usr/lib/perl5/site_perl/5.8/DBIx/Class/ResultSourceHandle.pm line 64. You lost your ResultSource. This is normal when storing ResultSets in a cache AFAIK. Use DBIx::Class::Cursor::Cached (works grea

[Dbix-class] Serialize::Storable and InflateColumn::DateTime

2007-11-14 Thread Tobias Kremer
I was just checking out Serialize::Storable together with some simple custom memcached functionality implemented in a Catalyst controller. I'm getting this error when trying to use the cached version of my ResultSet: Can't call method "datetime_parser" on an undefined value at /usr/local/share/per

Re: [Dbix-class] many-to-many with attributes (again)

2007-10-15 Thread Tobias Kremer
> The many-many helper will provide add_to_mm_name and similar methods that > can take two hashrefs so you can provide far side and link attributes > simultaneously - but for retrieval of the attributes the proxy trick is still > the way to go. Great and not so great. This means that whenever I ad

Re: [Dbix-class] many-to-many with attributes (again)

2007-10-12 Thread Tobias Kremer
Quoting Tobias Kremer <[EMAIL PROTECTED]>: > Is the approach described in the (now offline) DBIC wiki still the way to go > if you want to access attributes stored in the table linking two other tables > in a many-to-many relationship? > I'm just asking to make sure

[Dbix-class] many-to-many with attributes (again)

2007-10-10 Thread Tobias Kremer
Is the approach described in the (now offline) DBIC wiki still the way to go if you want to access attributes stored in the table linking two other tables in a many-to-many relationship? http://web.archive.org/web/20070204122440/dbix-class.shadowcatsystems.co.uk/index.cgi?ManyToManyWithAttributes