Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Egg::Plugin::DBIC::Transaction
Plugin that supports transaction of DBIC.

Egg::Plugin::DBIC::Transaction - Plugin that supports transaction of DBIC.


NAME

Egg::Plugin::DBIC::Transaction - Plugin that supports transaction of DBIC.


SYNOPSIS


  use Egg qw/ DBIC::Transaction /;

  

  __PACKAGE__->egg_startup(

    ...

    .....

    MODEL => [ [ DBIC => {} ] ],

    );

  # Object (MODEL) of MySchema is acquired.

  my $model= $e->myschema_schema;

  

  # dbh of MySchema is acquired.

  my $dbh= $e->myschema_dbh;

  

  # An arbitrary table object is acquired.

  my $table= $e->myschema_table('any_table');

  

  # MySchema is commit.

  $e->myschema_commit;

  

  # MySchema is rollback.

  $e->myschema_rollback;

  

  # After all processing is completed, MySchema is commit.

  $e->myschema_commit_ok(1);

  

  # It is a rollback after all processing is completed as for MySchema.

  $e->myschema_rollback_ok(1);


DESCRIPTION

It is a plugin that adds an automation of the transaction management by the Egg::Model::DBIC manpage and some convenient accessors.

Interrupt concerning the transaction is done by the call from following Egg.

* Because this plugin uses the method of the same to the Egg::Plugin::DBI::Transaction manpage name, it is not possible to use it at the same time.


METHODS

[schema_name]_schema

The object of Schema is returned.

schema_name is always a small letter.

It is the same as $e->model([SCHEMA_NAME]).


  my $model= $e->myschema_schema;

[schema_name]_dbh

The data base handler of Schema is returned.

It is the same as $e->model([SCHEMA_NAME])->storage->dbh.


  my $dbh= $e->myschema_dbh;

[schema_name]_table ( [TABLE_NAME] )

The table object that belongs to Schema is returned.

$e->model([SCHEMA_NAME])->resultset([TABLE_NAME]) or $e->model([SCHEMA_NAME]:[TABLE_NAME]) It is the same.


  my $table= $e->myschema_table('hoge');

[schema_name]_begin

If the transaction of schema_name is begun and $e->debug is effective, it reports to STDERR.

* This method need not be called from the application specifying it.

[schema_name]_commit

If schema_name is 'commit' at once and $e->debug is effective, it reports to STDERR.


  $e->myschema_commit;

[schema_name]_rollback

If it goes at once in the rollback of schema_name and $e->debug is effective, it reports to STDERR.


  $e->myschema_rollback;

[schema_name]_commit_ok ( [BOOL] )

After all processing ends, schema_name is 'commit' if an effective value is set.

An opposite at the same time value is set in [schema_name]_rollback_ok.


  $e->myschema_commit_ok(1);

[schema_name]_rollback_ok ( [BOOL] );

After all processing ends, the rollback of schema_name is done if an effective value is set.

An opposite at the same time value is set in [schema_name]_commit_ok.


  $e->myschema_rollback_ok(1);

commit ( [SCHEMA_LIST] )

All [SCHEMA_LIST] is 'commit'.


  $e->commit(qw/ MySchema AnySchema /);

commit_ok ( [SCHEMA_LIST] )

All 'commit_ok' of [SCHEMA_LIST] is made effective.


  $e->commit_ok(qw/ MySchema AnySchema /);

rollback ( [SCHEMA_LIST] )

[SCHEMA_LIST] is done and all 'rollback' is done.


  $e->rollback(qw/ MySchema AnySchema /);

rollback_ok ( [SCHEMA_LIST] )

All rollback_ok of [SCHEMA_LIST] is made effective.


  $e->rollback_ok(qw/ MySchema AnySchema /);


SEE ALSO

the DBIx::Class manpage, the Egg::Model::DBIC manpage, the Egg::Release manpage,


AUTHOR

Masatoshi Mizuno <lushe@cpan.org>


COPYRIGHT

Copyright (C) 2007 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy