}
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
// [B] Place the policy into the database over writting an existing policy
try {
// -> first make sure that the policy is valid by parsing it
PolicyParser parser = new PolicyParser();
S3BucketPolicy sbp = parser.parse( policy, bucketName );
bPolicyDao.deletePolicy(bucketName);
if (null != policy && !policy.isEmpty()) {
BucketPolicyVO bpolicy = new BucketPolicyVO(bucketName, client, policy);
bpolicy = bPolicyDao.persist(bpolicy);