equal
deleted
inserted
replaced
89 CFileStore* store; |
89 CFileStore* store; |
90 switch (aMode) |
90 switch (aMode) |
91 { |
91 { |
92 default: |
92 default: |
93 __LEAVE(KErrNotSupported); |
93 __LEAVE(KErrNotSupported); |
94 // When the file cache in file server is on, the order of file writing is not guaranteed which could cause data inconsistency in some circumstances, for example, when the power is lost in the middle of data transaction. Therefore, the file write cache is switched off here to maintain the file integrity . |
|
95 case TDbFormat::ECreate: |
94 case TDbFormat::ECreate: |
96 store=CPermanentFileStore::CreateL(iFs,aName,EFileRead|EFileWrite|EFileWriteDirectIO); |
95 store=CPermanentFileStore::CreateL(iFs,aName,EFileRead|EFileWrite); |
97 break; |
96 break; |
98 // When the file cache in file server is on, the order of file writing is not guaranteed which could cause data inconsistency in some circumstances, for example, when the power is lost in the middle of data transaction. Therefore, the file write cache is switched off here to maintain the file integrity . |
|
99 case TDbFormat::EReplace: |
97 case TDbFormat::EReplace: |
100 store=CPermanentFileStore::ReplaceL(iFs,aName,EFileRead|EFileWrite|EFileWriteDirectIO); |
98 store=CPermanentFileStore::ReplaceL(iFs,aName,EFileRead|EFileWrite); |
101 break; |
99 break; |
102 }; |
100 }; |
103 iStore=store; |
101 iStore=store; |
104 iDelete=ETrue; // cleanup fully in case of failure |
102 iDelete=ETrue; // cleanup fully in case of failure |
105 store->SetTypeL(aType); |
103 store->SetTypeL(aType); |
138 { |
136 { |
139 __ASSERT(!iName); // check construction phase |
137 __ASSERT(!iName); // check construction phase |
140 // |
138 // |
141 iName=aName.AllocL(); |
139 iName=aName.AllocL(); |
142 const TUint mode=aMode==TDbFormat::EReadOnly ? EFileShareReadersOnly : EFileWrite; |
140 const TUint mode=aMode==TDbFormat::EReadOnly ? EFileShareReadersOnly : EFileWrite; |
143 // When the file cache in file server is on, the order of file writing is not guaranteed which could cause data inconsistency in some circumstances, for example, when the power is lost in the middle of data transaction. Therefore, the file write cache is switched off here to maintain the file integrity . |
|
144 mode=mode|EFileWriteDirectIO; |
|
145 CFileStore* store=CPermanentFileStore::OpenL(iFs,*iName,mode); |
141 CFileStore* store=CPermanentFileStore::OpenL(iFs,*iName,mode); |
146 iStore=store; |
142 iStore=store; |
147 CDbStoreDatabase::RestoreL(DatabaseIdL(store->Root())); |
143 CDbStoreDatabase::RestoreL(DatabaseIdL(store->Root())); |
148 } |
144 } |
149 |
145 |