No, I don't use isUnique validation rule. Here is my $validation
array:
var $validate=array(
'for_date'=>array('required'=>VALID_NOT_EMPTY,
'date'=>array('rule'=>array('date', 'ymd')),
'length'=>array('rule'=>array('between',10,10))),
'marketing_campaign_id'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between',1,12),
'allowEmpty'=>true, 'required'=>false)),
'marketing_group_id'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between',1,12),
'allowEmpty'=>true, 'required'=>false)),
'marketing_creative_id'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between',1,12),
'allowEmpty'=>true, 'required'=>false)),
'marketing_criterion_id'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between',1,12),
'allowEmpty'=>true, 'required'=>false)),
'impressions'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between',1,12),
'allowEmpty'=>true, 'required'=>false),
'positive'=>array('rule'=>array('comparison', '>=', 0),
'allowEmpty'=>true, 'required'=>false)),
'clicks'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between',1,12),
'allowEmpty'=>true, 'required'=>false),
'positive'=>array('rule'=>array('comparison', '>=', 0),
'allowEmpty'=>true, 'required'=>false)
'ctr'=>array('number'=>array('rule'=>VALID_NUMBER, 'allowEmpty'=>true,
'required'=>false),
'maxlength'=>array('rule'=>array('between', 1, 22),
'allowEmpty'=>true, 'required'=>false),
'positive'=>array('rule'=>array('comparison', '>=', 0),
'allowEmpty'=>true, 'required'=>false)),
'cpc'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between', 1, 22),
'allowEmpty'=>true, 'required'=>false),
'positive'=>array('rule'=>array('comparison', '>=', 0),
'allowEmpty'=>true, 'required'=>false)),
'conversions'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between',1,12),
'allowEmpty'=>true, 'required'=>false),
'positive'=>array('rule'=>array('comparison', '>=', 0),
'allowEmpty'=>true, 'required'=>false)),
'conversion_rate'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between', 1, 22),
'allowEmpty'=>true, 'required'=>false),
'positive'=>array('rule'=>array('comparison', '>=', 0),
'allowEmpty'=>true, 'required'=>false)),
'cost'=>array('number'=>array('rule'=>VALID_NUMBER,
'allowEmpty'=>true, 'required'=>false),
'maxlength'=>array('rule'=>array('between', 1, 5)),
'positive'=>array('rule'=>array('comparison', '>=', 0)))))
Today I've tried to just validate data with $Model->saveAll($data,
array('validate'=>only)) and problem is still present, so I don't
think caching queries(or not) would solve it.
On Oct 14, 9:31 am, "Dr. Loboto" <[email protected]> wrote:
> What validation rules do you use? If there is isUnique, for example,
> for each check it makes database query, result is saved in memory (if
> cacheQueries is on) and query string is saved in SQL log (if debug is
> 2).
>
> On Oct 13, 5:15 pm, senser <[email protected]> wrote:
>
> > Hello,
>
> > I try to save a large number of records with Cake (latest stable 1.2
> > branch) but script stops with fatal error because of memory exhausted.
> > I have about 30000 records that must be stored in mysql. I use
> > $Model->saveAll($data, array('validate'=>true, 'atomic'=>true)), but even
>
> > with 1024MB memory limit, script fails. I've tried to save each record
> > with loop and $Model->save($data) instead of $Model->saveAll(), but
> > this makes no difference. Disabling validation makes the trick though.
> > When records are not validated script consumes (almost) constant
> > amount of memory, in contrast to case when data is validated then on
> > every loop iteration memory consumption grows (I measure memory with
> > memory_get_usage()).
>
> > Any ideas how to solve this?
> > Thanks!
>
>
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en