[symfony-users] [help] one to many relationship on admin generator

2011-01-04 Thread riky jtk
Hi all,

I want to ask question, how to show relation on admin generator.
example:

in backend i have article list (which generated by admin gen), i want if i
click each of one article, i get list of comment for that article..

I use symfony 1.4, doctrine, and sfAdminThemeJrollerPlugin (jquery).

maybe,laiguAdminThemeplugin can be inspiration. but it is extJs based.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Re: Using UUIDs for primary keys vs AutoIncrementing/Sequence based primary keys

2011-01-04 Thread Gareth McCumskey
Just be careful of blindly using a specific system for your primary key ids.
Everything you said is absolutely true ... if you need it. We have used
character based ids before but only when we absolutely had to because the
benefits were critical to the running of our application. In my experience,
90% of cases do not require use of characters and integers are sufficient,
even across multiple db's.

To respond to Mass, 4 characters is reached really quickly (again depending
on how active your app is). For our purposes efficiency is the number 1
priority because we create something like a few thousand records a day.
Having to have a programmatically generated and inserted id is far too slow
for our needs as well as doing searches across a CHAR column.

On Tue, Jan 4, 2011 at 8:46 PM, Dennis  wrote:

> Well, there are quite a few good reasons to use UUIDs.
>
>   1. It is unique for the current domains. As a primary key it
> uniquely identifies the table
>   and or databse in distributed applications.
>   2. Less chances of for duplication.
>   3. Suitable for inserting and updating large amount of data.
>   4. Easy for merging data across servers.
>   5. The thing that UUIDs buy you that is very difficult to do
> otherwise is to get a unique
>  identifier without having to consult or coordinate with a central
> authority
>   6. When displaying row ids in public intefaces like the web, or
> easily
>   examinable APIs, obfuscated IDs prevent or make difficult:
>  A/ Sequential scraping of data.
>  B/ Knowing CURENT size of data or customer base.
>  C/ Observing GROWTH of sizeof data or customer base.
>   7. Since any row identifying primary or secondary key has to be
> unique,
>   the database designer might as well use the obfuscated ID as the
> primary
>   ID.
>   8. In large, multinationally distrubuted applications,, #5 above is
> very
>   important, especially during replication and merging of databases.
>
> So as always, if the ADVANTAGES out weigh the disavantages, then
> UUIDs are the correct choice.
>
> More on this subject, (and do google on UUID vs Integer.
>
> http://www.codinghorror.com/blog/2007/03/primary-keys-ids-versus-guids.html
>
> http://databases.aspfaq.com/database/what-should-i-choose-for-my-primary-key.html
>
>
> On Jan 4, 6:13 am, Massimiliano Arione  wrote:
> > On 4 Gen, 13:41, Gareth McCumskey  wrote:
> >
> > > To be perfectly honest, why bother? What advantage does turning a more
> > > efficient integer based, autoincrement ID column into a more
> inefficient,
> > > multi-byte character column, even if you could get "autoincrement"
> working
> > > for characters? Any app that requires a unique ID for the primary key
> should
> > > work fine integers. Characters just make database slower.
> >
> > You can find discussions on mysql forum, stating that char key is
> > slower than integer key only if char is longer than 4.
> > IMHO a char primary key is nice when you need a key that is human
> > readable (e.g. for a state/province)
> > I used it myself with any problem.
> > Of course, you need to specify by hand a key value when/if you insert
> > a new row, but that's all.
> >
> > cheers
> > Massimiliano
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Struggling with embeding sfGuardUser fields in my form (symfony 1.4.8, sfDoctrineGuardPlugin-5.0.0)

2011-01-04 Thread dmitrypol
To clarify - when I say "nothing shows up in member/edit" I mean that all 
regular member form fields do show up.  I just can't get the 
BasesfGuardUserAdminForm fields to display.  

Thank you Alexandre.  I was not using admin forms but I created 
generator.yml file (generated it via doctrine:generate-module 
--generate-in-cache) and added this:
config:
  form:
display:  [sgu, address, ...]
sgu is from $this->embedForm('sgu', $sguForm);
But BasesfGuardUserAdminForm fields still don't display.  

I am not sure what you mean by "parent class do not call the configure 
sub-method".  When I added die('lol') in memberForm->configure (right after 
$this->embedForm('sgu', $sguForm);
) and refreshed member/edit page it displayed [?php 
use_stylesheets_for_form($form) ?] [?php use_javascripts_for_form($form) ?] 
*lol.  *So memberForm->configure is called.  

I thank you all in advance for any advice or assistance.  

Dmitry

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


[symfony-users] Re: Using UUIDs for primary keys vs AutoIncrementing/Sequence based primary keys

2011-01-04 Thread Dennis
Well, there are quite a few good reasons to use UUIDs.

   1. It is unique for the current domains. As a primary key it
uniquely identifies the table
   and or databse in distributed applications.
   2. Less chances of for duplication.
   3. Suitable for inserting and updating large amount of data.
   4. Easy for merging data across servers.
   5. The thing that UUIDs buy you that is very difficult to do
otherwise is to get a unique
  identifier without having to consult or coordinate with a central
authority
   6. When displaying row ids in public intefaces like the web, or
easily
   examinable APIs, obfuscated IDs prevent or make difficult:
  A/ Sequential scraping of data.
  B/ Knowing CURENT size of data or customer base.
  C/ Observing GROWTH of sizeof data or customer base.
   7. Since any row identifying primary or secondary key has to be
unique,
   the database designer might as well use the obfuscated ID as the
primary
   ID.
   8. In large, multinationally distrubuted applications,, #5 above is
very
   important, especially during replication and merging of databases.

So as always, if the ADVANTAGES out weigh the disavantages, then
UUIDs are the correct choice.

More on this subject, (and do google on UUID vs Integer.

http://www.codinghorror.com/blog/2007/03/primary-keys-ids-versus-guids.html
http://databases.aspfaq.com/database/what-should-i-choose-for-my-primary-key.html


On Jan 4, 6:13 am, Massimiliano Arione  wrote:
> On 4 Gen, 13:41, Gareth McCumskey  wrote:
>
> > To be perfectly honest, why bother? What advantage does turning a more
> > efficient integer based, autoincrement ID column into a more inefficient,
> > multi-byte character column, even if you could get "autoincrement" working
> > for characters? Any app that requires a unique ID for the primary key should
> > work fine integers. Characters just make database slower.
>
> You can find discussions on mysql forum, stating that char key is
> slower than integer key only if char is longer than 4.
> IMHO a char primary key is nice when you need a key that is human
> readable (e.g. for a state/province)
> I used it myself with any problem.
> Of course, you need to specify by hand a key value when/if you insert
> a new row, but that's all.
>
> cheers
> Massimiliano

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


[symfony-users] Re: sfDoctrineRoute::getObject returns an object in action:new

2011-01-04 Thread Jonotron
To clarify, I'm not actually trying to do getObject in the action
code... I'm debugging a custom filterChain filter that uses getObject
and it seems like the DoctrineRoute object isn't playing as well as it
should.

On Jan 4, 9:49 am, Jonotron  wrote:
> I've set up my routing config like this:
>
> page:
>   class: sfDoctrineRouteCollection
>   options: { model: Page }
>
> in my page executeNew() action code, if I do this:
>   $this->getRoute()->getObject();
>
> it returns an object (appears to be the first Page object in the
> database)
>
> This doesn't seem like correct behaviour to me. The new action
> shouldn't be associated with any object at all so getObject should
> return null, no? Am I doing something wrong?
>
> Thanks in advance

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


[symfony-users] sfDoctrineRoute::getObject returns an object in action:new

2011-01-04 Thread Jonotron
I've set up my routing config like this:

page:
  class: sfDoctrineRouteCollection
  options: { model: Page }

in my page executeNew() action code, if I do this:
  $this->getRoute()->getObject();

it returns an object (appears to be the first Page object in the
database)

This doesn't seem like correct behaviour to me. The new action
shouldn't be associated with any object at all so getObject should
return null, no? Am I doing something wrong?

Thanks in advance

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] [Symfony2] Application transaction question

2011-01-04 Thread Gustavo Adrian
I mean a notification system for other apps that may have to react to the
event descripted on the notification. If this notification never arrives,
the other apps couldn't be react as they should on that event. Of course I
can mark the step as failed and retry later. Of course I'm looking for an
edge case but I want to be prepared for any case. I'm developing some sort
of CRM that will then expanded to a business management (don't know if this
is the term in english). So I'll need all kind of workflows and a good error
handling if any step fails in the way.

Anyway, in short, I need to use some kind of workflow to manage the steps
require for the process and, if some of the steps fails, I can mark them asi
"failed" and retry later to begin from that point, and finish the workflow.
I see it viable.



Thanks for your feedback!

On Tue, Jan 4, 2011 at 9:20 AM, Gareth McCumskey wrote:

> I still question whether the notification event, by whatever mechanic you
> decide, is really that critical for success. Do you really need to base the
> entire success of the transaction in part on the success of a courtesy
> message? Is the message itself really that critical to the success of the
> transaction? Bearing in mind that most of the apps I have developed that has
> some kind of notification system, the notifications are usually just a
> courtesy to make a users life simpler and there are alternate means for a
> user to see if a transaction was successful, such as a web page to see the
> newly created entity.
>
> Perhaps reconsider the need to have an entire transactions success/failure
> be dependant on a notification.
>
>
> On Tue, Jan 4, 2011 at 1:52 PM, Gustavo Adrian <
> comfortablynum...@gmail.com> wrote:
>
>> Thanks for your answer Gareth.
>>
>> I used an email send as a step just for simplicity. It's very true that
>> email sending is very unreliable. I was really thinking in every case. Maybe
>> register a message in a message service to notify other applications
>> involved of the event ocurred? the only thing that came to mind is that if
>> the step fails to do its job (in this case, if the message couldn't be send
>> for whatever reason), I could put it on a queue and retry later.
>>
>> In the case of a workflow that I'll create in my app too, configured even
>> by the user, if a step fails to execute for whatever reason, the step could
>> be have a status of failed, and retry again later. Maybe
>> every business transaction could be configured as a workflow if any other
>> action is needed after the entity/entities are created/updated/deleted? that
>> way at least I would manage all the situations on the same way, and I could
>> handle the steps needed in every business transaction, handling a retry
>> automatically in case of failure.
>>
>> What do you think?
>>
>>
>> Thanks!
>>
>>
>> On Tue, Jan 4, 2011 at 3:47 AM, Gareth McCumskey wrote:
>>
>>> Email is not reliable. Its as simple as that. The reason I say this
>>> however is that when you rely on systems outside of your control, such as
>>> mail servers because remember, the recipients mail server also needs to be
>>> fully functional, you need to bear in mind that reliability is very likely.
>>>
>>> All you can do is decide is what is more important. If you create an
>>> entity and the email doesn't get through to the recipient, do you really
>>> need to roll back the creation of that entity? Is it that vital that the
>>> email is sent that it should affect whether a record in a database exists or
>>> not? And if the target recipient is a human and not an automated system
>>> checking mail box programmatically, there is additional reliability issues.
>>> What if the recipient is not in that day? Has a power failure? Or just
>>> doesn't bother reading his/her mail?
>>>
>>> If the system reading the mail box is an automated program, then there
>>> are far better ways to communicate between software systems than using the
>>> relatively unreliable method of email.
>>>
>>> TLDNR: It is very very difficult to verify that an email sent to a
>>> specific recipient arrived (I would even lean to impossible). Find an
>>> alternate way to inform people if its that critical.
>>>
>>>  On Mon, Jan 3, 2011 at 3:41 PM, Gustavo Adrian <
>>> comfortablynum...@gmail.com> wrote:
>>>
  Hi all,

 I know is not a Symfony specific question but I was wondering how do you
 guys manage a situation like the following:

 . Create an entity and save it to the database
  . Save the log to a file or whatever resource the system has
 . Send an email to notify people involved with the entity that this item
 was added to the system


 Now, if the entity doesn't get saved on the DB because of an error, you
 can rollback the transaction and everything is good. But what about the 
 case
 in that the email couldn't be send because, for example, of an error on the
 SMTP server? the DB transaction was already commited, but

Re: [symfony-users] Struggling with embeding sfGuardUser fields in my form (symfony 1.4.8, sfDoctrineGuardPlugin-5.0.0)

2011-01-04 Thread Alexandre Salomé
Can be because :

   - Your admin-gen has a set of fields configured in generator.yml, that
   doesn't include subform
  - Try commenting the line with the form edit fields
   - A parent class do not call the configure sub-method
  - Try adding die('lol'); in your configure method

Good luck

2011/1/4 dmitrypol 

> I have a table member where I store basic user info (address, phone, etc)
> which has relations:  sfGuardUser:  { local: sgu_id, foreign: id }.  I am
> trying to modify memberForm to display the First Name, Last Name, Email,
> Username, Password fields (from sf_guard_user) so users can change them.
>
> class memberForm extends BasememberForm
> {
>   public function configure()
>   {
> $sguForm = new
> BasesfGuardUserAdminForm(sfContext::getInstance()->getUser()->getGuardUser());
> unset($sguForm['is_active'], $sguForm['is_super_admin'],
> $sguForm['updated_at'], $sguForm['groups_list'],
> $sguForm['permissions_list'] );
> $this->embedForm('sgu', $sguForm);
> #$this->mergeForm($sguForm);
> $this->setWidgets(array(
> ...
>
> But for the life of me nothing shows up in member/edit.  I read various
> tutorials (
> http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin,
> http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms)
> but no luck.  Can anyone point me in the right direction?  Thank you very
> much.
>
> Dmitry
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Alexandre Salomé
http://alexandre-salome.fr

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


[symfony-users] Struggling with embeding sfGuardUser fields in my form (symfony 1.4.8, sfDoctrineGuardPlugin-5.0.0)

2011-01-04 Thread dmitrypol
I have a table member where I store basic user info (address, phone, etc) 
which has relations:  sfGuardUser:  { local: sgu_id, foreign: id }.  I am 
trying to modify memberForm to display the First Name, Last Name, Email, 
Username, Password fields (from sf_guard_user) so users can change them.  

class memberForm extends BasememberForm
{
  public function configure()
  {
$sguForm = new 
BasesfGuardUserAdminForm(sfContext::getInstance()->getUser()->getGuardUser());
unset($sguForm['is_active'], $sguForm['is_super_admin'], 
$sguForm['updated_at'], $sguForm['groups_list'], 
$sguForm['permissions_list'] );
$this->embedForm('sgu', $sguForm);
#$this->mergeForm($sguForm);
$this->setWidgets(array(
...

But for the life of me nothing shows up in member/edit.  I read various 
tutorials 
(http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin,
 
http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms) 
but no luck.  Can anyone point me in the right direction?  Thank you very 
much.  

Dmitry

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


[symfony-users] Re: Using UUIDs for primary keys vs AutoIncrementing/Sequence based primary keys

2011-01-04 Thread Massimiliano Arione
On 4 Gen, 13:41, Gareth McCumskey  wrote:
> To be perfectly honest, why bother? What advantage does turning a more
> efficient integer based, autoincrement ID column into a more inefficient,
> multi-byte character column, even if you could get "autoincrement" working
> for characters? Any app that requires a unique ID for the primary key should
> work fine integers. Characters just make database slower.

You can find discussions on mysql forum, stating that char key is
slower than integer key only if char is longer than 4.
IMHO a char primary key is nice when you need a key that is human
readable (e.g. for a state/province)
I used it myself with any problem.
Of course, you need to specify by hand a key value when/if you insert
a new row, but that's all.

cheers
Massimiliano

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


[symfony-users] Removing myself from plugin contributors ?

2011-01-04 Thread Loïc Vernet
Hi,

How to remove myself from the list of the contributors of a plugin ?

We should have a cross to do this in the admin tab. (Like when you are lead
of the plugin)

++ COil

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] How to insert multiple records with just one save() function call

2011-01-04 Thread Ramunas
Hi,

Try to use transactions. Things usually goes faster when you add all
of your records in one transaction and then commit them.


Tuesday, January 4, 2011, 12:54:33 AM, you wrote:

> Hi all

> I have a function that reads a CSV file and then save the record to
> the database. The code snippet is as the following

> while ($data = $reader->read())
> {
> // some logics here

> $np = new Np();
> $np->setTime(date("Y-m-d H:i:s",($data[0] - 25569) * 86400 - 28800));
> // more set
> $np->setMerged(0);
> $np->save();
> }

> While the code works just fine, there's a hiccup to it; the while loop
> takes a very long time to finish because the there are thousands of
> record in the CSV file and the save() function's I/O make things slow.

> I just want to know if there's any function in Doctrine which would
> allow me to do all this with just one call off the save() function

> Thanks




-- 
Symfony Configuration Reference - everything you can't find elsewhere:
http://www.symfonyreference.com

2011.01.04

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


[symfony-users] How to insert multiple records with just one save() function call

2011-01-04 Thread mohdshakir
Hi all

I have a function that reads a CSV file and then save the record to
the database. The code snippet is as the following

while ($data = $reader->read())
{
// some logics here

$np = new Np();
$np->setTime(date("Y-m-d H:i:s",($data[0] - 25569) * 86400 - 28800));
// more set
$np->setMerged(0);
$np->save();
}

While the code works just fine, there's a hiccup to it; the while loop
takes a very long time to finish because the there are thousands of
record in the CSV file and the save() function's I/O make things slow.

I just want to know if there's any function in Doctrine which would
allow me to do all this with just one call off the save() function

Thanks

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Using UUIDs for primary keys vs AutoIncrementing/Sequence based primary keys

2011-01-04 Thread Gareth McCumskey
To be perfectly honest, why bother? What advantage does turning a more
efficient integer based, autoincrement ID column into a more inefficient,
multi-byte character column, even if you could get "autoincrement" working
for characters? Any app that requires a unique ID for the primary key should
work fine integers. Characters just make database slower.

On Mon, Jan 3, 2011 at 7:12 AM, Dennis Gearon  wrote:

> Is it very easy to specify a char column for a primary key in a symfony
> table/object?
>
> Actually, it's probably easy to do, BUT will Symfony choke on acually USING
> it?
>
> Do I have to provide a hook for 'NEXT value', 'LAST value' somewhere in the
> mix?
>
> One alternative is to have the usual integer primary key but call the other
> one
> something like 'display_id'. Howver, that won't help in the long run when
> doing
> replication and distributed applications.
>
> Any tips here?
>
>  Dennis Gearon
>
>
> Signature Warning
> 
> It is always a good idea to learn from your own mistakes. It is usually a
> better
> idea to learn from others’ mistakes, so you do not have to make them
> yourself.
> from 'http://blogs.techrepublic.com.com/security/?p=4501&tag=nl.e036'
>
>
> EARTH has a Right To Life,
> otherwise we all die.
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] [Symfony2] Application transaction question

2011-01-04 Thread Gareth McCumskey
I still question whether the notification event, by whatever mechanic you
decide, is really that critical for success. Do you really need to base the
entire success of the transaction in part on the success of a courtesy
message? Is the message itself really that critical to the success of the
transaction? Bearing in mind that most of the apps I have developed that has
some kind of notification system, the notifications are usually just a
courtesy to make a users life simpler and there are alternate means for a
user to see if a transaction was successful, such as a web page to see the
newly created entity.

Perhaps reconsider the need to have an entire transactions success/failure
be dependant on a notification.

On Tue, Jan 4, 2011 at 1:52 PM, Gustavo Adrian
wrote:

> Thanks for your answer Gareth.
>
> I used an email send as a step just for simplicity. It's very true that
> email sending is very unreliable. I was really thinking in every case. Maybe
> register a message in a message service to notify other applications
> involved of the event ocurred? the only thing that came to mind is that if
> the step fails to do its job (in this case, if the message couldn't be send
> for whatever reason), I could put it on a queue and retry later.
>
> In the case of a workflow that I'll create in my app too, configured even
> by the user, if a step fails to execute for whatever reason, the step could
> be have a status of failed, and retry again later. Maybe
> every business transaction could be configured as a workflow if any other
> action is needed after the entity/entities are created/updated/deleted? that
> way at least I would manage all the situations on the same way, and I could
> handle the steps needed in every business transaction, handling a retry
> automatically in case of failure.
>
> What do you think?
>
>
> Thanks!
>
>
> On Tue, Jan 4, 2011 at 3:47 AM, Gareth McCumskey wrote:
>
>> Email is not reliable. Its as simple as that. The reason I say this
>> however is that when you rely on systems outside of your control, such as
>> mail servers because remember, the recipients mail server also needs to be
>> fully functional, you need to bear in mind that reliability is very likely.
>>
>> All you can do is decide is what is more important. If you create an
>> entity and the email doesn't get through to the recipient, do you really
>> need to roll back the creation of that entity? Is it that vital that the
>> email is sent that it should affect whether a record in a database exists or
>> not? And if the target recipient is a human and not an automated system
>> checking mail box programmatically, there is additional reliability issues.
>> What if the recipient is not in that day? Has a power failure? Or just
>> doesn't bother reading his/her mail?
>>
>> If the system reading the mail box is an automated program, then there are
>> far better ways to communicate between software systems than using the
>> relatively unreliable method of email.
>>
>> TLDNR: It is very very difficult to verify that an email sent to a
>> specific recipient arrived (I would even lean to impossible). Find an
>> alternate way to inform people if its that critical.
>>
>>  On Mon, Jan 3, 2011 at 3:41 PM, Gustavo Adrian <
>> comfortablynum...@gmail.com> wrote:
>>
>>>  Hi all,
>>>
>>> I know is not a Symfony specific question but I was wondering how do you
>>> guys manage a situation like the following:
>>>
>>> . Create an entity and save it to the database
>>>  . Save the log to a file or whatever resource the system has
>>> . Send an email to notify people involved with the entity that this item
>>> was added to the system
>>>
>>>
>>> Now, if the entity doesn't get saved on the DB because of an error, you
>>> can rollback the transaction and everything is good. But what about the case
>>> in that the email couldn't be send because, for example, of an error on the
>>> SMTP server? the DB transaction was already commited, but the email failed.
>>> This situation would need to put all three steps in some sort of application
>>> transaction boundary, so in case any of the three steps fails, you can
>>> rollback the entire app transaction.
>>>
>>> One "solution" would be to begin the DB transaction, execute the three
>>> steps, and commit the DB transaction at the end. So if any error occurs in
>>> one of the three steps, you do a rollback to the DB and that's it. The
>>> problem with this approach, as you may guess, is that if you have a very
>>> long steps chain, you'll have the tables / rows involved in the transaction
>>> locked in the meantime, or the data you use in your transaction could be
>>> changed by other user if the transaction hasn't the proper isolation type.
>>> Not a good choice, definitely.
>>>
>>> Another solution would be to handle this with a workflow "engine",
>>> registering each step in a workflow and, if one step fails, try to retry
>>> later.
>>>
>>>
>>>
>>> How do you guys handle this cases? a workflow is the o

[symfony-users] i18n extract to multiple categories

2011-01-04 Thread Vikos
Hello.

Can symfony direcly extract i18n texts to the sepicfied - not the
messeges.xml - catalogues?
(to multiple catalogues).

Tanks!!
Vikos

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] [Symfony2] Application transaction question

2011-01-04 Thread Gustavo Adrian
Thanks for your answer Gareth.

I used an email send as a step just for simplicity. It's very true that
email sending is very unreliable. I was really thinking in every case. Maybe
register a message in a message service to notify other applications
involved of the event ocurred? the only thing that came to mind is that if
the step fails to do its job (in this case, if the message couldn't be send
for whatever reason), I could put it on a queue and retry later.

In the case of a workflow that I'll create in my app too, configured even by
the user, if a step fails to execute for whatever reason, the step could be
have a status of failed, and retry again later. Maybe
every business transaction could be configured as a workflow if any other
action is needed after the entity/entities are created/updated/deleted? that
way at least I would manage all the situations on the same way, and I could
handle the steps needed in every business transaction, handling a retry
automatically in case of failure.

What do you think?


Thanks!

On Tue, Jan 4, 2011 at 3:47 AM, Gareth McCumskey wrote:

> Email is not reliable. Its as simple as that. The reason I say this however
> is that when you rely on systems outside of your control, such as mail
> servers because remember, the recipients mail server also needs to be fully
> functional, you need to bear in mind that reliability is very likely.
>
> All you can do is decide is what is more important. If you create an entity
> and the email doesn't get through to the recipient, do you really need to
> roll back the creation of that entity? Is it that vital that the email is
> sent that it should affect whether a record in a database exists or not? And
> if the target recipient is a human and not an automated system checking mail
> box programmatically, there is additional reliability issues. What if the
> recipient is not in that day? Has a power failure? Or just doesn't bother
> reading his/her mail?
>
> If the system reading the mail box is an automated program, then there are
> far better ways to communicate between software systems than using the
> relatively unreliable method of email.
>
> TLDNR: It is very very difficult to verify that an email sent to a specific
> recipient arrived (I would even lean to impossible). Find an alternate way
> to inform people if its that critical.
>
> On Mon, Jan 3, 2011 at 3:41 PM, Gustavo Adrian <
> comfortablynum...@gmail.com> wrote:
>
>> Hi all,
>>
>> I know is not a Symfony specific question but I was wondering how do you
>> guys manage a situation like the following:
>>
>> . Create an entity and save it to the database
>>  . Save the log to a file or whatever resource the system has
>> . Send an email to notify people involved with the entity that this item
>> was added to the system
>>
>>
>> Now, if the entity doesn't get saved on the DB because of an error, you
>> can rollback the transaction and everything is good. But what about the case
>> in that the email couldn't be send because, for example, of an error on the
>> SMTP server? the DB transaction was already commited, but the email failed.
>> This situation would need to put all three steps in some sort of application
>> transaction boundary, so in case any of the three steps fails, you can
>> rollback the entire app transaction.
>>
>> One "solution" would be to begin the DB transaction, execute the three
>> steps, and commit the DB transaction at the end. So if any error occurs in
>> one of the three steps, you do a rollback to the DB and that's it. The
>> problem with this approach, as you may guess, is that if you have a very
>> long steps chain, you'll have the tables / rows involved in the transaction
>> locked in the meantime, or the data you use in your transaction could be
>> changed by other user if the transaction hasn't the proper isolation type.
>> Not a good choice, definitely.
>>
>> Another solution would be to handle this with a workflow "engine",
>> registering each step in a workflow and, if one step fails, try to retry
>> later.
>>
>>
>>
>> How do you guys handle this cases? a workflow is the only choice?
>>
>>
>>
>> Thanks.
>>
>> --
>> If you want to report a vulnerability issue on symfony, please send it to
>> security at symfony-project.com
>>
>> You received this message because you are subscribed to the Google
>> Groups "symfony users" group.
>> To post to this group, send email to symfony-users@googlegroups.com
>> To unsubscribe from this group, send email to
>> symfony-users+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-users?hl=en
>>
>
>
>
> --
> Gareth McCumskey
> http://garethmccumskey.blogspot.com
> twitter: @garethmcc
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users

[symfony-users] Doctrine:migrate give error "table exists"

2011-01-04 Thread seifolah Ghaderi
Hi any body.
I  added some column to my exist table in schema and add new table too.
Now for migrate databse i did the following:
1- then run doctrine:generate-migrations-diff
2-then I run  doctrine:migrate
but it give me the error that table or column exists:

- SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'mark'
already exists. Failing Query: "CREATE TABLE mark (id BIGINT AUTO_INCREMENT,
title VARCHAR(255), utitle VARCHAR(255), dsc TEXT, created_at DATETIME NOT
NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) ENGINE =
INNODB"

   - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'model'
already exists. Failing Query: "CREATE TABLE model (id BIGINT
AUTO_INCREMENT, title VARCHAR(255), utitle VARCHAR(255), dsc TEXT, mark_id
BIGINT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL,
PRIMARY KEY(id)) ENGINE =
INNODB"

   - SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name
'color'. Failing Query: "ALTER TABLE post ADD color
VARCHAR(20)"

   - SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name
'year'. Failing Query: "ALTER TABLE post ADD year BIGINT"



Whats the problem?
How does doctrine migrate works?!!
I have several migration class in my lib/migration/doctrine,and for my
change it seems that it generate 2 class for it,The first  for add new table
and new column and the second  for add foreign key (new column).I'm
surprised why it create and drop one of my table that i didn't modify it
really!no column added and no change accured.However i changed a line and
using Backspace keybord undo my chang!

Al last what's wrong and is there any solution that prevent to drop database
and recreate it again for a simple migration?
I don't want to lose my data.
thanks for any help

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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