[CDBI] Transaction over parent and children has_a objects

[prev] [thread] [next] [Date index for 2005/08/09]

From: Christopher H. Laco
Subject: [CDBI] Transaction over parent and children has_a objects
Date: 01:49 on 09 Aug 2005
This is a cryptographically signed message in MIME format.

--===============1887597450==
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature";
	micalg=sha1; boundary="------------ms090307000408040304060903"

This is a cryptographically signed message in MIME format.

--------------ms090307000408040304060903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I'm at wits end with something that is simple in SQL, but apparently a 
pain the butt under CBDI.

All I'm really after is to turn autocommit off, update a parent and 
multiple child has_a record, them commit or rollback the entire 
transaction. Something like:

DBI->do('BEIGN TRANSACTION');

$artist->name('foo')
$artist->cds('CD1')->name('Bar');

DBI->do('COMMIT TRANSACTION');

My main problem is that normally, Artist and CD objects are 
autoupdate(1), but in this situation, I need the Artist all of the CDs 
to be autoupdate(0); without looping through them and setting them 
manually. [Of course $artist->autoupdate(0) can be set easily).

Does this hack cover all child objects under has_a/has_many for the 
parent object? 
http://search.cpan.org/~tmtm/Class-DBI-0.96/lib/Class/DBI.pm#TRANSACTIONS

-=Chris

--------------ms090307000408040304060903
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIII8TCC
AtMwggI8oAMCAQICAw37vjANBgkqhkiG9w0BAQQFADBiMQswCQYDVQQGEwJaQTElMCMGA1UE
ChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNv
bmFsIEZyZWVtYWlsIElzc3VpbmcgQ0EwHhcNMDUwMjA3MTc0NDM3WhcNMDYwMjA3MTc0NDM3
WjBFMR8wHQYDVQQDExZUaGF3dGUgRnJlZW1ha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AIAwDQYIKoZIhvcNAwICAUAwBwYFKw4DAgcwDQYIKoZIhvcN
AwICASgweAYJKwYBBAGCNxAEMWswaTBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3Rl
IENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVt
YWlsIElzc3VpbmcgQ0ECAw37vjB6BgsqhkiG9w0BCRACCzFroGkwYjELMAkGA1UEBhMCWkEx
JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0
ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAgMN+74wDQYJKoZIhvcNAQEBBQAEggEA
cQttmT4DL5gEMJiLpcbrre1qIABWFUaGT07XMjm1t3Q6Biqi+Nb/47wHFqJZ2RK+NzMuoKoK
y8eimaNKA53DSLa9n0GePBNRFKU9B8IC86sZffmWdjY+XXTwN+mM25+ypMHNNx19RqOjTYtN
mEJzbWd685gnGaAEqfPquyFW8XSi7FNh8X0LGYthpwp5utYg04dmqgapJY2lN1oBxWH9/JOU
dbdBG5OeU4cVtC6I8zfiF4st9JYVMwHlxNdu8FrsYsOv0g90ogbXREWxKZLY2pmW+ESfjlWl
v0D72g46FY/L+QleksbPDjP72TrIWYJzdM/yuqVvqynVR+aIJz27ggAAAAAAAA==
--------------ms090307000408040304060903--


--===============1887597450==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

--===============1887597450==--

[CDBI] has_many inflate?
Christopher H. Laco 23:48 on 08 Aug 2005

[CDBI] Transaction over parent and children has_a objects
Christopher H. Laco 01:49 on 09 Aug 2005

Re: [CDBI] has_many inflate?
William Ross 09:42 on 09 Aug 2005

Generated at 13:17 on 19 Aug 2005 by mariachi v0.52