Skip to content

Instantly share code, notes, and snippets.

@kmussel
kmussel / gist:5876430
Created June 27, 2013 13:32
Neo4j backtrace LockObtainFailedException.
This happens more often when making ajax request. To fix I have to delete teh write.lock file.
Java::JavaLang::RuntimeException (org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/Users/kmussel/development/Kyck/kyck_registrar_web/db/ha_neo_1/index/lucene/node/UserData_exact/write.lock):
org.neo4j.index.impl.lucene.LuceneDataSource.newIndexWriter(LuceneDataSource.java:701)
org.neo4j.index.impl.lucene.LuceneDataSource.syncGetIndexSearcher(LuceneDataSource.java:588)
org.neo4j.index.impl.lucene.LuceneDataSource.getIndexSearcher(LuceneDataSource.java:552)
org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:268)
org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:227)
org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:238)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Class (^PropertyClass)(NSMutableDictionary **);
PropertyClass = ^(NSMutableDictionary **dict){
/**
Doing stuff here
**/
return nil;
};
UIButton *peopleFilter = [UIButton buttonWithType:UIButtonTypeCustom];
peopleFilter.frame = CGRectMake(5, 3, 90, 28);
[peopleFilter setImage:[UIImage imageNamed:@"radio_button_off"] forState:UIControlStateNormal];
[peopleFilter setImage:[UIImage imageNamed:@"radio_button_on"] forState:UIControlStateSelected];
peopleFilter.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
peopleFilter.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[peopleFilter setTitle:@"PEOPLE & PLAYERS" forState:UIControlStateNormal];
peopleFilter.titleEdgeInsets = (UIEdgeInsets){2, 2, 0, 0};
peopleFilter.titleLabel.font = [UIFont fontWithName:@"Gotham-Bold" size:11];
- (NSTextCheckingResult *)linkAtPoint:(CGPoint)point
{
CGRect selfBounds = self.bounds;
static const CGFloat kVMargin = 5.0f;
if (!CGRectContainsPoint(CGRectInset(selfBounds, 0, -kVMargin), point))
{
return nil;
}
[self createTextFrame];
//Parsing URLS OUT:
NSArray *comp = [self.shareView.textView.text componentsSeparatedByString:@" "];
NSRegularExpression *expression = [NSRegularExpression regularExpressionWithPattern:@"(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))" options:NSRegularExpressionCaseInsensitive error:NULL];
nonCountingChars = 0;
replaceCnt = 0;
if(comp.count)
{
[linklist removeAllObjects];
for(NSString *txt in comp)
CGContextRef currentContext = UIGraphicsGetCurrentContext();
if(self.selected)
{
CGColorSpaceRef colorSpace =CGColorSpaceCreateDeviceRGB();
UIColor *startColor = [UIColor fromHexString:@"222222"];
CGFloat *startColorComponents =(CGFloat *)CGColorGetComponents([startColor CGColor]);
UIColor *endColor = [UIColor fromHexString:@"444444"];
CGFloat *endColorComponents =(CGFloat *)CGColorGetComponents([endColor CGColor]);
CGFloat colorComponents[8] = {
PostTableItem *pitem = [PostTableItem itemWithPost:post
dataSource:self
expanded:expanded
withBlock:nil];
pitem.urlBlock = ^{
[self.controller expandCellWithPost:post type:!expanded];
};
SECOND WAY: